MySQL用户管理和授权
#创建用户
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 [email protected] identified by ‘123456’;
grant select,update on ATM_bankDB.userinfo· to [email protected] identified by ‘123456’;
#授权视图查询权限
grant select on ATM_bankDB.atm_a to [email protected];
#修改当前用户密码
set password=PASSWORD(‘root’);
#修改其他用户密码
set password for [email protected] =PASSWORD(‘root’);
#删除用户
drop user [email protected];