删除、取消权限操做:mysql
1. drop user 'user_name'@'%';sql
2. drop user 'user_name'@'localhost'ide
3. flush privileges; //从新加载受权表spa
注意:delete from user where user='user_name';直接操做mysql.user表不行,重建同名用户时会出现“operation CREATE USER failed”错误提示信息io
添加用户、受权操做class
1. create USER ’user_name' identified by 'password'; //建立用户名和密码权限
2. grant ALL ON 'db_name'.'tb_name' TO 'user_name'@'%' identified by 'password' //给 ‘user_name’@'%'受权密码
3. grant ALL ON 'db_name'.'tb_name' TO 'user_name'@'localhost' identified by 'password' //给 'user_name'@'localhost'受权db
4. flush privileges; //从新加载受权表word