{"id":535,"date":"2021-08-13T11:46:56","date_gmt":"2021-08-13T03:46:56","guid":{"rendered":"https:\/\/22pig.com\/?p=535"},"modified":"2021-08-13T11:46:56","modified_gmt":"2021-08-13T03:46:56","slug":"mysql-%e9%87%8d%e7%bd%aeroot%e5%af%86%e7%a0%81","status":"publish","type":"post","link":"http:\/\/22pig.com\/?p=535","title":{"rendered":"mysql \u91cd\u7f6eroot\u5bc6\u7801"},"content":{"rendered":"<p>\u5fd8\u8bb0\u5bc6\u7801\u91cd\u7f6e\uff1a<\/p>\n<p>cd \/etc<\/p>\n<p>vi my.cnf<\/p>\n<p>\u5728[mysqld] \u4e0b\u65b0\u589e\u4e00\u884c<\/p>\n<p>&#8211;skip-grant-tables<\/p>\n<p>\u91cd\u542fmysqld, systemctl restart mysqld<\/p>\n<p>&nbsp;<\/p>\n<p>mysql -h localhost -uroot<\/p>\n<p>mysql&gt;use mysql;<\/p>\n<p>mysql&gt;select plugin from user where user=&#8217;root&#8217;;<\/p>\n<p>mysql&gt;update user set plugin=&#8217;mysql_native_password&#8217;;<\/p>\n<p>mysql&gt;update user set authentication_string=password(&#8216;123456&#8242;) where user=&#8217;root&#8217; and host=&#8217;localhost&#8217;;<\/p>\n<p>mysql&gt;flush privileges;<\/p>\n<p>\u5c06my.cnf\u4e2d\u65b0\u589e\u7684\u7684\u884c\uff0c\u5220\u9664<\/p>\n<p>\u91cd\u542fmysqld, systemctl restart mysqld<\/p>\n<p>\u641e\u5b9a\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5fd8\u8bb0\u5bc6\u7801\u91cd\u7f6e\uff1a cd \/etc vi my.cnf \u5728[mysqld] \u4e0b\u65b0\u589e\u4e00\u884c &#8211;skip-grant-tables \u91cd\u542fmysqld, systemctl restart mysqld &nbsp; mysql -h localhost -uroot mysql&gt;use mysql; mysql&gt;select plugin from user where user=&#8217;root&#8217;; mysql&gt;update user set plugin=&#8217;mysql_native_password&#8217;; mysql&gt;update user set authentication_string=password(&#8216;123456&#8242;) where user=&#8217;root&#8217; and host=&#8217;localhost&#8217;; mysql&gt;flush privileges; \u5c06my.cnf\u4e2d\u65b0\u589e\u7684\u7684\u884c\uff0c\u5220\u9664 \u91cd\u542fmysqld, systemctl restart mysqld \u641e\u5b9a\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-535","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=535"}],"version-history":[{"count":0,"href":"http:\/\/22pig.com\/index.php?rest_route=\/wp\/v2\/posts\/535\/revisions"}],"wp:attachment":[{"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=535"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/22pig.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}