{"id":712,"date":"2023-04-14T12:22:10","date_gmt":"2023-04-14T04:22:10","guid":{"rendered":"http:\/\/www.inhhh.com\/blog\/?p=712"},"modified":"2023-04-20T16:21:46","modified_gmt":"2023-04-20T08:21:46","slug":"mysql-8-0%e4%bf%ae%e6%94%b9%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"http:\/\/www.inhhh.com\/blog\/?p=712","title":{"rendered":"mysql 8.0\u4fee\u6539\u5bc6\u7801"},"content":{"rendered":"\n<p>\u73af\u5883\uff1a<\/p>\n\n\n\n<p>1.\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff1a\u8fdb\u5165\/etc\/mysql\/mysql.conf.d\/ \uff0c\u5728\u914d\u7f6e\u6587\u4ef6mysqld.cnf\u4e0b\u6dfb\u52a0 skip-grant-tables<\/p>\n\n\n\n<p>2.\u5728\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4\uff1asudo service mysql restart\u6765\u91cd\u65b0\u542f\u52a8mysql\u670d\u52a1<\/p>\n\n\n\n<p>3.\u8f93\u5165:mysql -u root -p\uff0c\u56de\u8f66\u8fdb\u5165mysql\uff08\u6b64\u65f6\u4e0d\u9700\u8981\u5bc6\u7801\u5373\u53ef\u76f4\u63a5\u8fdb\u5165\uff09<\/p>\n\n\n\n<p>4.\u8f93\u5165\uff1ause mysql\uff1b<\/p>\n\n\n\n<p>5.\u8f93\u5165:update user set authentication_string=\u2018\u2019 where user=\u2018root\u2019;,\u5c06authentication_string \u7f6e\u7a7a;<\/p>\n\n\n\n<p>6.\u8f93\u5165\uff1aalter user \u2018root\u2019@\u2018localhost\u2019 identified by \u2018newpassword\u2019\uff1b\uff0cnewpassword\u4e3a\u8981\u4fee\u6539\u7684\u65b0\u5bc6\u7801\uff1b<\/p>\n\n\n\n<p>\u6b64\u65f6\u63d0\u793a\u9519\u8bef\uff1aERROR 1290 (HY000): The MySQL server is running with the &#8211;skip-grant-tables option so it cannot execute this statement<\/p>\n\n\n\n<p>\u8f93\u5165\uff1aFLUSH PRIVILEGES;<\/p>\n\n\n\n<p>\u518d\u91cd\u65b0alter user \u2018root\u2019@\u2018localhost\u2019 identified by \u2018newpassword\u2019\uff1b<\/p>\n\n\n\n<p>\u6b64\u65f6\u9519\u8bef\u63d0\u793a\u4e3a\uff1aERROR 1524 (HY000): Plugin \u2018auth_socket\u2019 is not loaded<\/p>\n\n\n\n<p>\uff0c<\/p>\n\n\n\n<p>\u8f93\u5165select user,plugin from mysql.user;\u6765\u67e5\u770bplugin<\/p>\n\n\n\n<p>\u8fd9\u91cc\u8f93\u5165update user set plugin=\u2018mysql_native_password\u2019 where user=\u2018root\u2019;\u5c06plugin\u6539\u4e3a\u4ee5\u524d\u7248\u672c\u7684\u5bc6\u7801\u8ba4\u8bc1\u65b9\u5f0f<\/p>\n\n\n\n<p>\u7136\u540e\u8f93\u5165\uff1aFLUSH PRIVILEGES;<\/p>\n\n\n\n<p>\u518d\u91cd\u8bd5alter user \u2018root\u2019@\u2018localhost\u2019 identified by \u2018newpassword\u2019\uff1b\u5373\u53ef\u4fee\u6539\u5bc6\u7801<\/p>\n\n\n\n<p>7.\u4fee\u6539\u5b8c\u6210\u540e\u8f93\u5165FLUSH PRIVILEGES;<\/p>\n\n\n\n<p>\u5c06\u7b2c\u4e00\u6b65\u7684skip-grant-tables\u6ce8\u91ca\u6389\uff1b<br>9.\u8f93\u5165service mysql restart\u91cd\u542fmysql<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883\uff1a 1.\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff1a\u8fdb\u5165\/etc\/mysql\/mysql.conf.d\/ \uff0c\u5728\u914d\u7f6e\u6587\u4ef6mysqld.cn<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/www.inhhh.com\/blog\/?p=712\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-712","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=712"}],"version-history":[{"count":2,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions"}],"predecessor-version":[{"id":720,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions\/720"}],"wp:attachment":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}