ruby-on-rails - 如何使用 mysql@5.6 修复“无法加载身份验证插件'caching_sha2_password'”
问题描述
数据库创建失败并Authentication plugin 'caching_sha2_password' cannot be loaded
出现错误。
当我运行以下命令时发生上述错误:
$ RAILS_ENV=test rake db:create
错误信息:
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql@5.6/5.6.46/lib/plugin/caching_sha2_password.so, 2): image not found
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>true, "pool"=>5, "socket"=>"/tmp/mysql.sock", "username"=>"root", "password"=>nil, "database"=>"ht_test"}, charset: utf8, collation: utf8_unicode_ci
(if you set the charset manually, make sure you have a matching collation)
我知道其他开发人员对 mysql@8.* 也有类似的问题。这就是为什么我切换到mysql@5.6
. 我仍然面临这个问题。
请提出可能的解决方案。
谢谢
解决方案
尝试使用它,它对我有用
ALTER USER 'yourusername'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'youpassword';
推荐阅读
- .htaccess - htaccess:重写到可选数量的“子文件夹” www.xyz.com/a/b/c/d
- spring - 角度代理问题得到 index.html 或 cors 错误
- opencv - 将 cvtColor 与 CV_8U 的 Mat 一起使用的问题
- r - 将数据框的多列从字符串转换为R中的数字
- c# - 正则表达式匹配所有字符直到到达字符,但也包括最后一个匹配
- javascript - 使用javascript验证表单中的选择时出错
- rust - 如何测试对象的其他特征函数
- html - Outlook 桌面的徽标大小调整
- powershell - [System.Web.Security.Membership]::GeneratePassword() - 找不到类型
- c# - OnItemDataBound 将列表视图中的链接按钮注册到更新面板脚本管理器,但是,它们仅在第一次单击时起作用