本文主要是介绍mysql创建用户报错bug——ERROR 1396 (HY000): Operation CREATE USER failed for 'zabbix'@'localhost',希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
背景:mysql中删除又想重建zabbix用户,但是执行创建命令报错。
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
4 rows in set (0.00 sec)
mysql> create user 'zabbix'@'localhost' identified by 'Test@1234';
ERROR 1396 (HY000): Operation CREATE USER failed for 'zabbix'@'localhost'
可以看到mysql用户中并没有zabbix,可是却无法创建,经查阅这是一个mysql官方bug:
This bug has been sitting on bugs.mysql.com since 2007 and this thread is mainly just a parroting of all those wrong answers even up to a year ago.
解决方法:
drop user zabbix@localhost;
flush privileges;
create user zabbix@localhost identified by 'admins_password'
参考文档:
https://stackoverflow.com/questions/5555328/error-1396-hy000-operation-create-user-failed-for-jacklocalhost
这篇关于mysql创建用户报错bug——ERROR 1396 (HY000): Operation CREATE USER failed for 'zabbix'@'localhost'的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!