{"id":142,"date":"2024-05-01T22:29:56","date_gmt":"2024-05-02T05:29:56","guid":{"rendered":"https:\/\/eisaichen.com\/?p=142"},"modified":"2024-05-01T22:29:56","modified_gmt":"2024-05-02T05:29:56","slug":"mysql-8-4-docker-unknown-variable-default-authentication-pluginmysql_native_password","status":"publish","type":"post","link":"https:\/\/eisaichen.com\/?p=142","title":{"rendered":"MySql 8.4 Docker unknown variable &#8216;default-authentication-plugin=mysql_native_password&#8217;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you always using the <code>mysql_native_password<\/code> plugin for authentication like me, after updating to 8.4.0, the MySQL container will stuck in a crash loop with the following message.<br><code>[ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even if you delete that argument, all users including root still can not get authenticated, because the <code>mysql_native_password<\/code> will be disabled by default. Unless you start the mysqldb with no existing data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To fix this problem, remove the <code>default-authentication-plugin=mysql_native_password<\/code> argument and use this new one instead <code>--mysql-native-password=ON<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example\u00a0<code>docker-compose.yml<\/code>\u00a0for\u00a0<code>mysql<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Use root\/example as user\/password credentials\nservices:\n\n  db:\n    image: mysql:8.4\n    # 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\n    # (this is just an example, not intended to be a production configuration)\n    command: --mysql-native-password=ON\n    restart: always\n    ports:\n      - 3306:3306\n    environment:\n      MYSQL_ROOT_PASSWORD: example<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"187\" src=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-01-104319-1024x187.png\" alt=\"\" class=\"wp-image-145\" srcset=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-01-104319-1024x187.png 1024w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-01-104319-300x55.png 300w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-01-104319-768x140.png 768w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-01-104319.png 1480w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;default-authentication-plugin=mysql_native_password&#8217;. Even if you delete that argument, all users including root still can not get authenticated, because the mysql_native_password will be disabled by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":143,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[4],"class_list":["post-142","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-mysql"],"_links":{"self":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":2,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/media\/143"}],"wp:attachment":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}