作者:e1985522z | 来源:互联网 | 2023-09-01 15:10
在搭建zabbix服务端时,将zabbix用户删除之后,无法重新创建:
MariaDB [mysql]> create user zabbix@localhost identified by 'passwd';
ERROR 1396 (HY000): Operation CREATE USER failed for 'zabbix'@'localhost'
查看目前的用户:select * from user\G;
发现其实并没有zabbix用户。猜想可能是刷新问题。百度得到如下结果:
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.
这是mysql官方的一个bug
将用户删除-刷新-重新创建即可
MariaDB [mysql]> drop user zabbix@localhost;
Query OK, 0 rows affected (0.01 sec)MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.01 sec)MariaDB [mysql]> create user zabbix@localhost identified by 'passwd';
Query OK, 0 rows affected (0.00 sec)