更改mysql8认证方式_mysql8.0认证方式修改 slnngk

使用xtrabackup备份mysql8.0的时候报如下错误:

[root@localhost bin]# ./innobackupex --defaults-file=/opt/mha/mysql8/conf/my.cnf --user=root --password=mysql -P13306 --socket=/opt/mha/mysql8/mysql.sock /opt/mha/xbackup

190923 15:27:03 innobackupex: Starting the backup operation

IMPORTANT: Please check that the backup run completes successfully.

At the end of a successful backup run innobackupex

prints "completed OK!".

190923 15:27:03  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=13306;mysql_socket=/opt/mha/mysql8/mysql.sock' as 'root'  (using password: YES).

Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;port=13306;mysql_socket=/opt/mha/mysql8/mysql.sock','root',...) failed: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory at - line 1314.

190923 15:27:03 Connecting to MySQL server host: localhost, user: root, password: set, port: 13306, socket: /opt/mha/mysql8/mysql.sock

Failed to connect to MySQL server: Authentication plugin 'caching_sha2_password' cannot be loaded: /mnt/workspace/percona-xtrabackup-2.4-binary-tarball/label_exp/centos6-64/TARGET/xtrabackup-build.FdAMXd/percona-xtrabackup-2.4.7-Linux-x86_64/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory.

解决办法:

1.兼容新老版本的认证方式

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql';

2.修改配置文件,加入如下项,并重启动

[mysqld]

default_authentication_plugin=mysql_native_password

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值