{"id":3176,"date":"2018-02-23T08:37:03","date_gmt":"2018-02-23T00:37:03","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=3176"},"modified":"2018-02-23T08:37:03","modified_gmt":"2018-02-23T00:37:03","slug":"mysql-%e4%bf%ae%e6%94%b9root%e5%af%86%e7%a0%81%e7%9a%844%e7%a7%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/shujuku\/mysql-%e4%bf%ae%e6%94%b9root%e5%af%86%e7%a0%81%e7%9a%844%e7%a7%8d%e6%96%b9%e6%b3%95\/","title":{"rendered":"MySQL\u2014\u2014\u4fee\u6539root\u5bc6\u7801\u76844\u79cd\u65b9\u6cd5"},"content":{"rendered":"<p>\u65b9\u6cd51\uff1a \u7528SET PASSWORD\u547d\u4ee4<br \/>\n\u9996\u5148\u767b\u5f55MySQL\u3002<br \/>\n\u683c\u5f0f\uff1amysql&gt; set password for \u7528\u6237\u540d@localhost = password(&#8216;\u65b0\u5bc6\u7801&#8217;);<br \/>\n\u4f8b\u5b50\uff1amysql&gt; set password for root@localhost = password(&#8216;123&#8217;);<\/p>\n<p>\u65b9\u6cd52\uff1a\u7528mysqladmin<br \/>\n\u683c\u5f0f\uff1amysqladmin -u\u7528\u6237\u540d -p\u65e7\u5bc6\u7801 password \u65b0\u5bc6\u7801<br \/>\n\u4f8b\u5b50\uff1amysqladmin -uroot -p123456 password 123<\/p>\n<p>\u65b9\u6cd53\uff1a\u7528UPDATE\u76f4\u63a5\u7f16\u8f91user\u8868<br \/>\n\u9996\u5148\u767b\u5f55MySQL\u3002<br \/>\nmysql&gt; use mysql;<br \/>\nmysql&gt; update user set password=password(&#8216;123&#8242;) where user=&#8217;root&#8217; and host=&#8217;localhost&#8217;;<br \/>\nmysql&gt; flush privileges;<\/p>\n<p>\u65b9\u6cd54\uff1a\u5728\u5fd8\u8bb0root\u5bc6\u7801\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u8fd9\u6837<br \/>\n\u4ee5windows\u4e3a\u4f8b\uff1a<br \/>\n1. \u5173\u95ed\u6b63\u5728\u8fd0\u884c\u7684MySQL\u670d\u52a1\u3002<br \/>\n2. \u6253\u5f00DOS\u7a97\u53e3\uff0c\u8f6c\u5230mysql\\bin\u76ee\u5f55\u3002<br \/>\n3. \u8f93\u5165mysqld &#8211;skip-grant-tables \u56de\u8f66\u3002&#8211;skip-grant-tables \u7684\u610f\u601d\u662f\u542f\u52a8MySQL\u670d\u52a1\u7684\u65f6\u5019\u8df3\u8fc7\u6743\u9650\u8868\u8ba4\u8bc1\u3002<br \/>\n4. \u518d\u5f00\u4e00\u4e2aDOS\u7a97\u53e3\uff08\u56e0\u4e3a\u521a\u624d\u90a3\u4e2aDOS\u7a97\u53e3\u5df2\u7ecf\u4e0d\u80fd\u52a8\u4e86\uff09\uff0c\u8f6c\u5230mysql\\bin\u76ee\u5f55\u3002<br \/>\n5. \u8f93\u5165mysql\u56de\u8f66\uff0c\u5982\u679c\u6210\u529f\uff0c\u5c06\u51fa\u73b0MySQL\u63d0\u793a\u7b26 &gt;\u3002<br \/>\n6. \u8fde\u63a5\u6743\u9650\u6570\u636e\u5e93\uff1a use mysql; \u3002<br \/>\n6. \u6539\u5bc6\u7801\uff1aupdate user set password=password(&#8220;123&#8243;) where user=&#8221;root&#8221;;\uff08\u522b\u5fd8\u4e86\u6700\u540e\u52a0\u5206\u53f7\uff09 \u3002<br \/>\n7. \u5237\u65b0\u6743\u9650\uff08\u5fc5\u987b\u6b65\u9aa4\uff09\uff1aflush privileges;\u3000\u3002<br \/>\n8. \u9000\u51fa quit\u3002<br \/>\n9. \u6ce8\u9500\u7cfb\u7edf\uff0c\u518d\u8fdb\u5165\uff0c\u4f7f\u7528\u7528\u6237\u540droot\u548c\u521a\u624d\u8bbe\u7f6e\u7684\u65b0\u5bc6\u7801123\u767b\u5f55\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd51\uff1a \u7528SET PASSWORD\u547d\u4ee4 \u9996\u5148\u767b\u5f55MySQL\u3002 \u683c\u5f0f\uff1amysql&gt; set passwo &#8230; <a title=\"MySQL\u2014\u2014\u4fee\u6539root\u5bc6\u7801\u76844\u79cd\u65b9\u6cd5\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/shujuku\/mysql-%e4%bf%ae%e6%94%b9root%e5%af%86%e7%a0%81%e7%9a%844%e7%a7%8d%e6%96%b9%e6%b3%95\/\" aria-label=\"\u9605\u8bfb MySQL\u2014\u2014\u4fee\u6539root\u5bc6\u7801\u76844\u79cd\u65b9\u6cd5\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-3176","post","type-post","status-publish","format-standard","hentry","category-shujuku"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=3176"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3176\/revisions"}],"predecessor-version":[{"id":3177,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3176\/revisions\/3177"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=3176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=3176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=3176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}