mysql创建用户ERROR 1396 (HY000): Operation CREATE USER failed for XXXXXXXX

时间:2022-09-19 20:25:09

创建一个已经存在过的用户,即使已经执行过 delete from mysql.user where User='gerrit'


再重新创建也会报错,如下(gerrit账号是已经存在过,并且delete的):

mysql> CREATE USER 'gerrit'@'localhost' IDENTIFIED BY 'gerrit';
ERROR 1396 (HY000): Operation CREATE USER failed for 'gerrit'@'localhost'

解决方案:

drop user "gerrit"@"localhost";