{"id":6626,"date":"2024-11-14T10:22:07","date_gmt":"2024-11-14T02:22:07","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6626\/"},"modified":"2024-11-14T10:22:07","modified_gmt":"2024-11-14T02:22:07","slug":"solusi-mysql-%e9%94%99%e8%af%af%e6%97%a0%e6%b3%95%e5%90%af%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6626\/","title":{"rendered":"Solusi MySQL \u9519\u8bef\u65e0\u6cd5\u542f\u52a8"},"content":{"rendered":"<p>\u670b\u53cb\u4eec\u5927\u5bb6\u597d\uff0c\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u60f3\u5206\u4eab\u4e00\u4e2a\u5904\u7406  8.0 \u7684\u6559\u7a0b\uff0c\u5f53\u4f60\u5347\u7ea7\u5230 mysql 8.0 \u65f6\uff0c\u8be5\u6559\u7a0b\u5c06\u4e0d\u4f1a\u542f\u52a8<\/p>\n<h2> \u53d1\u751f\u7684\u9519\u8bef <\/h2>\n<p>\u597d\u5427\uff0c\u5f53\u6211\u5728 laragon \u5e94\u7528\u7a0b\u5e8f\u4e2d\u4ece<strong>mysql 5.1.72<\/strong>\u5347\u7ea7\u5230<strong>mysql 8.0.32<\/strong>\u65f6\uff0c\u53d1\u751f\u4e86\u8fd9\u4e2a\u9519\u8bef\u3002<\/p>\n<p>\u5f53\u6211\u5728 laragon \u5e94\u7528\u7a0b\u5e8f\u4e2d start all \u65f6\uff0c\u51fa\u73b0\u7684\u9519\u8bef\u662f\u8fd9\u6837\u7684\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/465\/014\/172405087988951.png\" class=\"aligncenter\" title=\"Solusi MySQL \u9519\u8bef\u65e0\u6cd5\u542f\u52a8\u63d2\u56fe\" alt=\"Solusi MySQL \u9519\u8bef\u65e0\u6cd5\u542f\u52a8\u63d2\u56fe\" \/><\/p>\n<p>laragon \u4e2d\u7684 mysql 8.0 \u9519\u8bef<\/p>\n<p>\u7136\u540e\u6211\u68c0\u67e5\u4e86\u4f4d\u4e8e<em>c:laragondatamysql-8mysqld.log\u7684\u65e5\u5fd7\u6587\u4ef6<\/em><\/p>\n<p>\u5728\u90a3\u91cc\u6211\u53d1\u73b0\u4e86\u5982\u4e0b\u9519\u8bef<\/p>\n<pre>mysqld: table 'mysql.plugin' doesn't exist\n2023-02-16t23:34:54.041942z 0 [error] [my-010735] [server] could not open the mysql.plugin table. please perform the mysql upgrade procedure.\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u8fd8\u53d1\u73b0\u4e86\u8fd9\u6837\u7684\u9519\u8bef<\/p>\n<pre>2023-02-16t23:34:54.460889z 0 [error] [my-010326] [server] fatal error: can't open and lock privilege tables: table 'mysql.user' doesn't exist\n2023-02-16t23:34:54.462984z 0 [error] [my-010952] [server] the privilege system failed to initialize correctly. for complete instructions on how to upgrade mysql to a new version please see the 'upgrading mysql' section from the mysql manual.\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ece\u8fd9\u4e2a\u9519\u8bef\u53ef\u4ee5\u660e\u663e\u770b\u51fa\u6211\u6240\u505a\u7684\u5347\u7ea7\u8fc7\u7a0b\u662f\u9519\u8bef\u7684\u3002 <strong>\u9519\u8bef\u662f\u6211\u6ca1\u6709\u5148\u521d\u59cb\u5316mysql 8.0\uff0c\u6240\u4ee5mysql 8.0\u627e\u4e0d\u5230\u6211\u9700\u8981\u7684\u8868<\/strong>.<\/p>\n<h2> \u89e3\u51b3\u65b9\u6848\uff1a\u521d\u59cb\u5316mysql <\/h2>\n<p>\u597d\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u505a\u7684\u89e3\u51b3\u65b9\u6848\u662f\u5148\u542f\u52a8mysql 8.0\uff0c\u7136\u540e\u518d\u542f\u52a8mysql\u670d\u52a1\u5668\u3002<\/p>\n<p>\u5728 windows \u4e2d\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre>mysqld --initialize-insecure\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u5b9e\u67092\u4e2a\u9009\u9879\uff0c\u7b2c\u4e00\u4e2a\u4f7f\u7528<strong>\u2013initialize<\/strong>\uff0c\u7b2c\u4e8c\u4e2a<strong>\u2013initialize-insecure<\/strong>\u3002\u552f\u4e00\u7684\u533a\u522b\u662f root \u5e10\u6237\u7684\u5bc6\u7801\u3002\u7b2c\u4e00\u4e2a\u9009\u9879\u5c06\u751f\u6210\u4e00\u4e2a\u4e34\u65f6\u968f\u673a\u5bc6\u7801\u3002\u5bf9\u4e8e\u7b2c\u4e8c\u4e2a\u9009\u9879\uff0croot\u8d26\u6237\u6ca1\u6709\u5bc6\u7801\uff0c\u4f46\u662f\u7a0d\u540e\u6211\u4eec\u53ef\u4ee5\u4e3aroot\u8bbe\u7f6e\u5bc6\u7801\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u542f\u52a8mysql 8.0\u7684\u8fc7\u7a0b\u5c31\u5b8c\u6210\u4e86\uff0c\u5230\u8fd9\u91cc\u5e94\u8be5\u5c31\u53ef\u4ee5\u542f\u52a8mysql 8.0\u6216\u8005\u670d\u52a1\u5668\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u4e86\u3002<\/p>\n<h2> \u66f4\u6539\u6839\u5bc6\u7801 <\/h2>\n<p>\u56e0\u4e3a\u6211\u4eec\u4f7f\u7528\u4e86\u7b2c\u4e8c\u4e2a\u9009\u9879\uff0c\u8fd9\u610f\u5473\u7740 root \u5e10\u6237\u6ca1\u6709\u5bc6\u7801\uff0c\u56e0\u6b64\u65e0\u9700\u4f7f\u7528\u5bc6\u7801\u5373\u53ef\u8f7b\u677e\u8bbf\u95ee\u3002\u5982\u679c\u662f\u5728\u672c\u5730\u7535\u8111\u4e0a\u4e5f\u8fd8\u53ef\u4ee5\uff0c\u56e0\u4e3aweb\u5f00\u53d1\u9700\u6c42\u4e5f\u66f4\u5feb<\/p>\n<p>\u4f46\u662f\u5982\u679c\u670b\u53cb\u60f3\u4e3aroot\u8d26\u6237\u6dfb\u52a0\u5bc6\u7801\uff0c\u4e5f\u5f88\u7b80\u5355<\/p>\n<p>\u9996\u5148\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165mysql\u547d\u4ee4\u884c\u3002<\/p>\n<pre>mysql -u root\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u767b\u5f55\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u4e0d\u8981\u5fd8\u8bb0\u6700\u540e\u4e00\u4e2a\u5206\u53f7\u3002<\/p>\n<pre>alter user 'root'@'localhost' identified by 'password_baru_untuk_root';\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06 <strong>new_password_for_root<\/strong> \u66f4\u6539\u4e3a\u60a8\u60f3\u8981\u7684\u5bc6\u7801\u3002\u7136\u540e\u8fdb\u5165\u3002<\/p>\n<p>\u73b0\u5728\u8fd0\u884c\u547d\u4ee4<strong>exit<\/strong>\u9000\u51famysql\u547d\u4ee4\u884c\u3002\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u7136\u540e\u8f93\u5165\u60a8\u4e4b\u524d\u521b\u5efa\u7684\u65b0\u5bc6\u7801\u3002<\/p>\n<pre>mysql -u root -p\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u795d\u4f60\u5c1d\u8bd5\u987a\u5229 ?<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSolusi MySQL \u9519\u8bef\u65e0\u6cd5\u542f\u52a8\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u670b\u53cb\u4eec\u5927\u5bb6\u597d\uff0c\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u60f3\u5206\u4eab\u4e00\u4e2a\u5904\u7406 8.0 \u7684\u6559\u7a0b\uff0c\u5f53\u4f60\u5347\u7ea7\u5230 mysql 8.0 \u65f6\uff0c\u8be5\u6559\u7a0b\u5c06\u4e0d\u4f1a\u542f\u52a8 \u53d1\u751f\u7684\u9519\u8bef \u597d\u5427\uff0c\u5f53\u6211\u5728 laragon \u5e94\u7528\u7a0b\u5e8f\u4e2d\u4ecemysql 5.1.72\u5347\u7ea7\u5230mysql 8.0.32\u65f6\uff0c\u53d1\u751f\u4e86\u8fd9\u4e2a\u9519\u8bef\u3002 \u5f53\u6211\u5728 laragon \u5e94\u7528\u7a0b\u5e8f\u4e2d start all \u65f6\uff0c\u51fa\u73b0\u7684\u9519\u8bef\u662f\u8fd9\u6837\u7684\u3002 laragon \u4e2d\u7684 mysql 8.0 \u9519\u8bef \u7136\u540e\u6211\u68c0\u67e5\u4e86\u4f4d\u4e8ec:laragondatamysql-8mysqld.log\u7684\u65e5\u5fd7\u6587\u4ef6 \u5728\u90a3\u91cc\u6211\u53d1\u73b0\u4e86\u5982\u4e0b\u9519\u8bef mysqld: table &#8216;mysql.plugin&#8217; doesn&#8217;t exist 2023-02-16t23:34:54.041942z 0 [error] [my-010735] [server] could not open the mysql.plugin table. please perform the mysql upgrade procedure. \u767b\u5f55\u540e\u590d\u5236 \u9664\u6b64\u4e4b\u5916\uff0c\u6211\u8fd8\u53d1\u73b0\u4e86\u8fd9\u6837\u7684\u9519\u8bef 2023-02-16t23:34:54.460889z 0 [error] [my-010326] [server] fatal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6626","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6626"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6626\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}