Rover12421's Blog

The End.

Mysql 添加删除用户

新建受限账号
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON database_name.* TO username@“%” IDENTIFIED BY ‘password’;

新建root权限账号
GRANT ALL PRIVILEGES ON database_name.* TO username@“%” IDENTIFIED BY ‘password’;

清楚所以权限
revoke all on database_name.* from username@localhost;

删除用户
delete from mysql.user where user=‘username’ and host=‘localhost’;

刷新内存中的权限表
flush privileges;

删除用户
drop user username@localhost;

Comments