I am trying to connect my rails app which is on my host to docker mysql image. But I am getting this error:
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql/5.7.22/lib/plugin/caching_sha2_password.so, 2): image not found
My Docker compose file is like this:
db:
image: mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: password
adminer:
image: adminer
restart: always
ports:
- 8080:8080
I am using this inside my database.yml:
default: &default
adapter: mysql2
encoding: utf8
host: 127.0.0.1
username: root
password: password
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# socket: /Applications/MAMP/tmp/mysql/mysql.sock
development:
<<: *default
database: meal_plan_development
What else I should do in order to connect my rails app to mysql docker image.