MySQL 8.4 upgrade authentication fix

Starting from MySQL 8.0.34, native authentication is deprecated in favor of caching_sha2_password. In MySQL 9, it will be completly removed.

In order to fix any authentication issue post-upgrade, you need to :

  • Enable native authentication back in your container entrypoint : mysqld --mysql-native-password=ON
  • Login : docker-compose exec my_database_container mysql -u my_user -p
  • Update your user : ALTER USER 'my_user'@'my_host' IDENTIFIED WITH caching_sha2_password BY 'my_password';
  • Revert your container entrypoint

You can now log in as usual.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.