mysql8.x开启远程登录

  mysql8.x密码的认证方式变了,需要修改远程认证方式

问题描述

Connection to lab-130-mysql failed.
Unable to load authentication plugin 'caching_sha2_password'.

问题解决

方法1

CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password  BY '123123';      //修改密码认证方式为mysql_native_password

GRANT ALL ON *.* TO 'root'@'%';

方法2

CREATE USER 'root'@'%' IDENTIFIED BY '123123';     //默认的密码认证插件caching_sha2_password

GRANT ALL ON *.* TO 'root'@'%'; 

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123123';

posted @ 2018-05-10 09:10  mvpbang  阅读(3240)  评论(0编辑  收藏  举报