1.创建用户名
create user'student';
2.创建用户名和密码
create user'teacher' identified by '123456';
create user'teacher' identified by '123456';
3.查询 users授权
select * from user\G;
GRANT SELECT,INSERT, UPDATE,DELETE,CREATE,DROP ON mysUSE mysql;
SELECT * FROM USER;
select * from user\G;
GRANT SELECT,INSERT, UPDATE,DELETE,CREATE,DROP ON mysUSE mysql;
SELECT * FROM USER;
4.启动mysql数据库
USE mysql;
USE mysql;
5.查询user,创建用户名或创建用户名和密码授权
SELECT * FROM USER;
SELECT * FROM USER;
CREATE USER'student';
CREATE USER'teacher' IDENTIFIED BY '123456';
CREATE USER'teacher' IDENTIFIED BY '123456';
SELECT * FROM FROM USER\G;
GRANT SELECT,INSERT, UPDATE,DELETE,CREATE,DROP ON mysql.`city` TO 'student';
6
.删除stuent用户名
DROP USER 'student';
7
.修改密码
set password [for 'username ']=password ("newpassword");