{"id":781,"date":"2024-07-16T14:50:37","date_gmt":"2024-07-16T06:50:37","guid":{"rendered":"https:\/\/www.luyouli.com\/?p=781"},"modified":"2024-07-16T15:05:35","modified_gmt":"2024-07-16T07:05:35","slug":"mysql-8-4-1-lts-9-0-0-%e6%8a%a5%e9%94%99unknown-variable-mysql_native_passwordon","status":"publish","type":"post","link":"https:\/\/www.luyouli.com\/?p=781","title":{"rendered":"MySQL 8.4.1 LTS\/9.0.0 \u62a5\u9519unknown variable &#8216;mysql_native_password=ON&#8217;."},"content":{"rendered":"\n<p>\u53d1\u751f\u4e86\u4e00\u4ef6\u975e\u5e38\u975e\u5e38\u975e\u5e38\u86cb\u75bc\u7684\u4e8b\u60c5<\/p>\n\n\n\n<p>\u7531\u4e8eMySQL\u6570\u636e\u662f\u4ece5.7.x\u4e00\u8def\u5347\u7ea7\u800c\u6765\uff0c\u4e00\u76f4\u6cbf\u7528\u4e4b\u524d\u7684mysql_native_password\u52a0\u5bc6\u63d2\u4ef6\uff0c\u4e4b\u524d\u5347\u7ea7\u52308.4.0 LTS\u7684\u65f6\u5019\u62a5\u9519\uff0c\u7279\u610f\u589e\u52a0\u4e86\u4e00\u884c\u914d\u7f6e\uff1amysql_native_password=ON<\/p>\n\n\n\n<p>\u8fd1\u671fmysql 8.4.1 LTS \u66f4\u65b0\u4e86\uff0c\u60f3\u7740\u73b0\u5728\u5df2\u7ecf\u662f8.4.0\u4e86\u7d22\u6027\u5c31\u5347\u7ea7\u4e00\u4e0b\uff0c\u7ed3\u679c\u86cb\u75bc\u7684\u4e8b\u60c5\u51fa\u73b0\u4e86\uff0c\u660e\u660e\u955c\u50cf\u6307\u5b9a\u4e86\uff1amysql:8.4.1\uff0c\u4f46\u662f\u5347\u7ea7\u5b8c\u4e4b\u540e\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u955c\u50cf\u540d\u5b57\u53d8\u6210\u4e86\uff1amysql:9.0.0\uff0c\u8fd8\u975e\u5e38\u86cb\u75bc\u7684\u544a\u8bc9\u6211\uff1aunknown variable &#8216;mysql_native_password=ON&#8217;<\/p>\n\n\n\n<p>\u540e\u6765\u53d1\u73b0\u8fd9\u4fe9\u955c\u50cf\u662f\u4e00\u6a21\u4e00\u6837\u7684<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1028\" height=\"70\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2024\/07\/image-3.png\" alt=\"\" class=\"wp-image-794\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2236\" height=\"432\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2024\/07\/image.png\" alt=\"\" class=\"wp-image-782\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1922\" height=\"662\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2024\/07\/image-1.png\" alt=\"\" class=\"wp-image-785\"\/><\/figure>\n\n\n\n<p>\u8fd9\u5c31\u54d4\u4e86\u72d7\u4e86\uff0c\u771f\u54d4\u4e86\u72d7\u4e86\uff0c\u6b64\u5904\u7701\u7565\u4e00\u4e07\u5b57\u5bf9MySQL\u7684\u6012\u8d5e\uff01\uff01\uff01<\/p>\n\n\n\n<p>\u67e5\u6765\u67e5\u53bb\u53d1\u73b0\u4e86\u4e24\u4ef6\u4e8b\u60c5\uff1a<\/p>\n\n\n\n<p>\u7b2c\u4e00\u4ef6\u4e8b\u60c5\uff1aMySQL 9.0.0\uff0c\u79fb\u9664mysql_native_password\u8ba4\u8bc1\u63d2\u4ef6<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u4ef6\u4e8b\u60c5\uff1aMySQL 9.0.0\uff0c\u65e0\u6cd5\u52a8\u6001\u52a0\u8f7dmysql_native_password\u8ba4\u8bc1\u63d2\u4ef6<\/p>\n\n\n\n<p>\u5b98\u65b9\u6587\u6863\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/native-pluggable-authentication.html#native-pluggable-authentication-installation\">https:\/\/dev.mysql.com\/doc\/refman\/8.4\/en\/native-pluggable-authentication.html#native-pluggable-authentication-installation<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n\n\n\n<p>1\u3001\u589e\u52a0\u914d\u7f6e<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[mysqld]<br>skip-grant-tables<\/pre>\n\n\n\n<p>2\u3001\u91cd\u542fmysql<\/p>\n\n\n\n<p>kubectl delete pod mysql-server-7d794599bd-q9xgn<\/p>\n\n\n\n<p>3\u3001\u514d\u5bc6\u767b\u5f55\u5230mysql\u91cc\u9762<\/p>\n\n\n\n<p>kubectl exec -it mysql-server-7d794599bd-q9xgn &#8212; bash<\/p>\n\n\n\n<p>mysql -uroot -p<\/p>\n\n\n\n<p>4\u3001\u4fee\u6539\u52a0\u5bc6\u89c4\u5219<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">USE mysql;<br>FLUSH PRIVILEGES;<br>UPDATE mysql.user SET plugin='caching_sha2_password', authentication_string='' WHERE user='root' AND host='localhost';<br>FLUSH PRIVILEGES;<br>ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY 'newpassword';<br>FLUSH PRIVILEGES;<\/pre>\n\n\n\n<p>5\u3001\u53bb\u9664\u589e\u52a0\u7684\u914d\u7f6e<\/p>\n\n\n\n<p>skip-grant-tables<\/p>\n\n\n\n<p>6\u3001\u91cd\u542fmysql<\/p>\n\n\n\n<p>kubectl delete pod mysql-server-7d794599bd-q9xga<\/p>\n\n\n\n<p>7\u3001\u91cd\u65b0\u767b\u5f55<\/p>\n\n\n\n<p>\u5e78\u4e8f\u65b0\u7248\u672c\u7684wordpress\u652f\u6301caching_sha2_password\u63d2\u4ef6\uff0c\u7701\u53bb\u4e86\u6211\u8f6c\u6362\u63d2\u4ef6\u7684\u65f6\u95f4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53d1\u751f\u4e86\u4e00\u4ef6\u975e\u5e38\u975e\u5e38\u975e\u5e38\u86cb\u75bc\u7684\u4e8b\u60c5 \u7531\u4e8eMySQL\u6570\u636e\u662f\u4ece5.7.x\u4e00\u8def\u5347\u7ea7\u800c\u6765\uff0c\u4e00\u76f4\u6cbf\u7528\u4e4b\u524d\u7684mysql_na [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,2],"tags":[],"class_list":["post-781","post","type-post","status-publish","format-standard","hentry","category-kubernetes","category-mysql"],"blocksy_meta":[],"views":2280,"_links":{"self":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=781"}],"version-history":[{"count":9,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/781\/revisions"}],"predecessor-version":[{"id":796,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/781\/revisions\/796"}],"wp:attachment":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}