1、创建用户
create user teacher @localhost identified by ‘123456’;
create user student @localhost;
2、删除用户
drop user bankmaster@localhost;
3、查看用户
select user,host from mysql.user;
4、创建用户并授权
grant insert,select on bank.users to syudent@localhost identified by ‘123456’;
grant all on bank.userinfo to bankmaster@localhost identified by ‘1234’;
5、为teacher@localhost用户授予bank数据库中view_users视图的查询权限
grant insert,select on bank.view_users to teacher@localhost;
6、修改当前用户密码
set password=PASSWORD(‘root’)
7、修改其他用户密码
set password for teacher @localhost=PASSWORD(‘8888’)
MySQL创建普通用户
最新推荐文章于 2024-05-11 15:29:22 发布