mysql异常之ERROR 1396 (HY000): Operation CREATE USER failed for

1.异常描述

mysql> create user 'huibang'@'%' identified by 'huibang@123';
ERROR 1396 (HY000): Operation CREATE USER failed for 'huibang'@'%'

2.解决方案

mysql> drop user 'huibang'@'%';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

mysql>  create user 'huibang'@'%' identified by 'huibang@123';
Query OK, 0 rows affected (0.00 sec)

原因

网上找了下原因: 
Assume the user is there, so drop the user 
After deleting the user, there is need to flush the mysql privileges 
Now create the user.

你可能感兴趣的:(mysql)