#创建用户
create user teacher @localhost identified by ‘123456’;
create user student @localhost ;
#查看用户
select user,host from mysql.user;
#创建用户并授权
grant select,update on ATM_bankDB.view_cardinfo to teacher@localhost identified by ‘123456’;
grant select,update on ATM_bankDB.userinfo· to teacher@localhost identified by ‘123456’;
#授权视图查询权限
grant select on ATM_bankDB.atm_a to students@localhost;
#修改当前用户密码
set password=PASSWORD(‘root’);
#修改其他用户密码
set password for teacher@localhost =PASSWORD(‘root’);
#删除用户
drop user teacher@localhost;
MySQL用户管理和授权
最新推荐文章于 2024-02-01 09:54:13 发布