3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

RailsでMySQL8を使うときに出てくる認証方式エラーのスマートな回避方法

Posted at

RailsでMySQL8を使おうとするとこのようなエラーが発生します。

Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

ググると原因と対処方法はたくさん出てきますが、どれも大体my.cnfを設定するという内容のものです。

もっとシンプルに対応できないのか?調べたところcommandとして設定を渡せば良いということが分かりました。
docker-composeだとこんな感じです。
MySQLのDockerHubにちゃんと書いてありました。

services:
  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?