赞
踩
创建一个user用户时发现报错
Operation CREATE USER failed for ‘sc_slave’@‘192.168.254.136’
root@(none) 21:23 mysql>create user 'sc_slave'@'192.168.254.136' identified by '123456';
ERROR 1396 (HY000): Operation CREATE USER failed for 'sc_slave'@'192.168.254.136'
查询后发现可能是之前建过这个用户
然后查询资料想直接删除这个用户
发现直接报错
root@(none) 21:26 mysql>drop user 'sc_slave'@'%';
ERROR 1396 (HY000): Operation DROP USER failed for 'sc_slave'@'%'
后发现是要用这个语句删除
解决:
root@(none) 21:24 mysql>delete from mysql.user where user ='sc_slave';
Query OK, 4 rows affected (0.01 sec)
必须先刷新权限后,再执行创建用户的命令,否则会再次报之前的错误
root@(none) 21:27 mysql>flush privileges;
Query OK, 0 rows affected (0.01 sec)
root@(none) 21:28 mysql>create user 'sc_slave'@'192.168.254.136' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。