If you always using the mysql_native_password
plugin for authentication like me, after updating to 8.4.0, the MySQL container will stuck in a crash loop with the following message.[ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
Even if you delete that argument, all users including root still can not get authenticated, because the mysql_native_password
will be disabled by default. Unless you start the mysqldb with no existing data.
To fix this problem, remove the default-authentication-plugin=mysql_native_password
argument and use this new one instead --mysql-native-password=ON
.
Example docker-compose.yml
for mysql
:
# Use root/example as user/password credentials
services:
db:
image: mysql:8.4
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
command: --mysql-native-password=ON
restart: always
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: example