系统环境CentOS 6.x+Mysql5.7
1.前言
在部署open-falcon的时候,第一启动有很多模块都失败,查看log日志有如下报错
...
2019/01/04 10:33:13 db.go:22: g.InitDB, get db conn fail this authentication plugin is not supported
...
2.通过度娘得知需要修改mysql的plugin模式
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user,plugin from user;
+------------------+-----------------------+
| user | plugin |
+------------------+-----------------------+
| mysql.infoschema | caching_sha2_password |
| mysql.session | caching_sha2_password |
| mysql.sys | caching_sha2_password |
| root | caching_sha2_password |
| zabbix | mysql_native_password |
+------------------+-----------------------+
5 rows in set (0.00 sec)
3.修改配置
由于使用的是root,所以需要修改root用户的plugin为mysql_native_password
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '密码';
Query OK, 0 rows affected (0.03 sec)
4.查看结果
mysql> select user,plugin from user;
+------------------+-----------------------+
| user | plugin |
+------------------+-----------------------+
| mysql.infoschema | caching_sha2_password |
| mysql.session | caching_sha2_password |
| mysql.sys | caching_sha2_password |
| root | caching_sha2_password |
| zabbix | mysql_native_password |
+------------------+-----------------------+
5 rows in set (0.00 sec)
5.重启mysql
# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
6.测试启动open-falcon后此报错消失