Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
483 views
in Technique[技术] by (71.8m points)

插件连接mysql时提示 Plugin caching_sha2_password could not be loaded

我在windows 10上部署了一个单节点DolphinDB,现在碰到的问题是用mysql插件连接不了mysql。我的代码如下:

loadPlugin(getHomeDir()+"/plugins/mysql/PluginMySQL.txt")
use mysql
connection=connect("127.0.0.1", 3306, `kr888, `dolphindb123, `tsDB)

在GUI中执行,报错如下:

conn = connect("127.0.0.1", 3306, "root", "kr888", "tsDB") => Failed to connect, error: ConnectionFailed : Plugin caching_sha2_password could not be loaded: ????????????顣 Library path is 'lib/mariadb/plugin/caching_sha2_password.dll' ((nullptr):3306), with errno: 2059

请问该怎么解决?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

出现这个原因是mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password。

解决步骤如下:

(1)管理员权限运行命令提示符,登录MySQL

mysql -u root -p

?

?

(2)修改账户密码加密规则并更新用户密码

? ?ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;? 
   ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';? ??

(3)刷新权限并重置密码

FLUSH PRIVILEGES;? ?#刷新权限?

上面两步对应的截图

单独重置密码命令:alter user 'root'@'localhost' identified by '111111';

现在再次用插件连接MySQL数据库就会发现可以连接成功了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...