0
0

DockerのMySQL8が起動出来ないエラーが発生した

Posted at

私の所属する部署では、LAMP環境をDockerで構築して開発をしています。
先日、メンバーから「MySQLが起動しない」との報告を受けました。

20240526-210410.jpeg

ERRORを見てみると、以下のエラーが発生していました。

[MY-013129][Server]A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending th information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
[MY-000067][Server]unknown variable 'default-authentication-plugin=mysql_native_password'.

ここで怪しいのが2つ目、[MY-000067]です。
「'default-authentication-plugin=mysql_native_password'って値がないよ」と言われていますね。

みんな大好き、StackOverflowを検索してみると、以下の投稿が行われていました。
unknown variable 'default-authentication-plugin=mysql_native_password' [closed]

どうやら、MySQL8のVer.8.4がリリースされており、'default-authentication-plugin=mysql_native_password'が非推奨になっているようです。

MySQLを構築しているDockerfileを以下のように変更しました。

FROM mysql:8
RUN echo "[mysqld]" >> /etc/mysql/my.cnf
# RUN echo "default-authentication-plugin=mysql_native_password" >> /etc/mysql/my.cnf
RUN echo "mysql-native-password=ON" >> /etc/mysql/my.cnf
RUN echo "authentication_policy=mysql_native_password,," >> /etc/mysql/my.cnf

このように変更し、buildされたmysqlを削除したうえで実行してみたところ、問題なく動作可能でした。

0
0
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
0
0