Mysql数据库用户和访问权限
用户和访问权限的操作
1)创建hello用户,可在本机登陆,密码为hello
create user hello@localhost identified by ‘hello’;
另一个shell中登陆该用户
创建用户hello,可在远程登陆,密码为hello
create user hello@’%’ identified by ‘hello’;
2)给hello@localhost用户授权,如果为all,授权所有权限
grant all on forever. to hello@localhost;*
3)查看用户授权
show grants for hello@localhost;
4)删除指定用户授权
revoke delete,update on forever. from hello@localhost;*
5)刷新,重载授权表
flush privileges;
6)删除用户
drop user hello@localhost;
还没有评论,来说两句吧...