插件连接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请问该怎么解决?
回答
出现这个原因是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数据库就会发现可以连接成功了
以上是 插件连接mysql时提示 Plugin caching_sha2_password could not be loaded 的全部内容, 来源链接: utcz.com/a/44619.html