Client does not support authentication protocol re
<h1>报警描述</h1>
<p>业务[<strong>],虚拟机[<em>.</em>.<em>.</em>],位于[</strong>],负责人[**]MySql端口号|3306|连通性状态报警状态为Client does notsupport authentication protocol requested by server, considerupgrading MySQL client</p>
<h1>说明</h1>
<p>mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password。主要原因是密码加密规则不同导致。
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=85beebcac7026635e4275158d205d9af&amp;file=file.png" alt="" /></p>
<p>解决办法:</p>
<pre><code>第一种:
如果监控账号已创建,可使用命令直接修改该账号的密码规则改为 mysql_native_password。
alter user '[user]'@'[host]' identified with mysql_native_password by '[password]';
示例:
alter user 'zgywmonitor'@'%' identified with mysql_native_password by 'zg1qaz@WSX#EDC';
第二种:
可删除旧的监控账号重新创建
drop user '[user]'@'[host]';
实例:
drop user 'zgywmonitor'@'%';
或是使用现有命令创建账号命令:
use mysql;
create user 'zgywmonitor'@'%' identified with mysql_native_password by 'zg1qaz@WSX#EDC';
grant select,show view on *.* to 'zgywmonitor'@'%';
grant replication client on *.* to 'zgywmonitor'@'%';
</code></pre>
<p>以上步骤完成后,要刷新权限:
FLUSH PRIVILEGES;</p>
<h1>监控对象</h1>
<p>MySQL数据库 8 以上版本</p>
<h1>监控方式</h1>
<p>通过nodejs的mysql驱动包监控mysql数据库</p>
<h1>规则</h1>
<p>默认为报警级别。</p>