Reputation: 55
Database creation fails with Authentication plugin 'caching_sha2_password' cannot be loaded
error.
Above error occurs when I run following command:
$ RAILS_ENV=test rake db:create
Error message:
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/[email protected]/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)
I know other developers had similar issues with mysql@8.* . Thats why I switched to [email protected]
. Still I am facing this issue.
Please suggest possible solutions.
Thanks
Upvotes: 1
Views: 4658
Reputation: 31
try using this, it worked for me
ALTER USER 'yourusername'@'localhost'
IDENTIFIED WITH mysql_native_password BY 'youpassword';
Upvotes: 1