Mysql5.7报错get db conn fail this authentication plugin is not supported

系统环境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后此报错消失
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值