{"id":111,"date":"2010-09-24T08:00:00","date_gmt":"2010-09-24T00:00:00","guid":{"rendered":"http:\/\/31.0.2.219:81\/?p=111"},"modified":"2014-03-11T14:00:20","modified_gmt":"2014-03-11T06:00:20","slug":"access-denied-for-user-rootlocalhost-using-passw","status":"publish","type":"post","link":"http:\/\/www.huike007.cn\/?p=111","title":{"rendered":"access denied for user root@localhost using passw"},"content":{"rendered":"<p>linux\u4e0b\uff1a<br \/>\n\u65b9\u6cd5\u4e00\uff1a<br \/>\n# \/etc\/init.d\/mysql stop<br \/>\n# mysqld_safe &#8211;user=mysql &#8211;skip-grant-tables &#8211;skip-networking &amp;<br \/>\n# mysql -u root mysql<br \/>\nmysql&gt; Up&#100;ate user SET Password=PASSWORD(\u2019newpassword\u2019) wh&#101;re USER=\u2019root\u2019;<br \/>\nmysql&gt; FLUSH PRIVILEGES;<br \/>\nmysql&gt; quit<br \/>\n# \/etc\/init.d\/mysql restart<br \/>\n# mysql -uroot -p<br \/>\nEnter password: &lt;\u8f93\u5165\u65b0\u8bbe\u7684\u5bc6\u7801newpassword&gt;<br \/>\nmysql&gt;<br \/>\n\u65b9\u6cd5\u4e8c\uff1a<br \/>\n\u76f4\u63a5\u4f7f\u7528\/etc\/mysql\/debian.cnf\u6587\u4ef6\u4e2d[client]\u8282\u63d0\u4f9b\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801:<br \/>\n# mysql -udebian-sys-maint -p<br \/>\nEnter password: &lt;\u8f93\u5165[client]\u8282\u7684\u5bc6\u7801&gt;<br \/>\nmysql&gt; Up&#100;ate user SET Password=PASSWORD(\u2019newpassword\u2019) wh&#101;re USER=\u2019root\u2019;<br \/>\nmysql&gt; FLUSH PRIVILEGES;<br \/>\nmysql&gt; quit<br \/>\n# mysql -uroot -p<br \/>\nEnter password: &lt;\u8f93\u5165\u65b0\u8bbe\u7684\u5bc6\u7801newpassword&gt;<br \/>\nmysql&gt;<br \/>\nWindows\u73af\u5883\u4e0b\uff1a<br \/>\n1. \u7ba1\u7406\u5458\u767b\u9646\u7cfb\u7edf,\u505c\u6b62mysql\u670d\u52a1\u6216\u8005\u7ed3\u675fmysqld-nt\u8fdb\u7a0b<br \/>\n2. \u8fdb\u5165\u547d\u4ee4\u884c,\u6765\u5230mysql\u7684\u5b89\u88c5\u76ee\u5f55.\u5047\u8bbe\u5b89\u88c5\u76ee\u5f55\u4e3a d:\\\\mysql\\\\ , CMD\u8fdb\u5165\u547d\u4ee4\u884c<br \/>\n3. \u8fd0\u884c d:\\\\mysql\\\\bin\\\\mysqld-nt &#8211;skip-grant-tables \u542f\u52a8mysql,\u5173\u95ed\u6743\u9650\u7684\u68c0\u67e5<br \/>\n4. \u8fd0\u884c d:\\\\mysql\\\\bin\\\\mysqladmin -u root flush-privileges password &#34;newpassword&#34; \u91cd\u8bberoot\u5bc6\u7801<br \/>\n5. \u91cd\u65b0\u542f\u52a8mysql\u670d\u52a1<br \/>\n\u7b2c4\u6b65\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539mysql\u8868,\u6240\u7528\u5230\u7684SQL\u8bed\u53e5\u540clinux\u90e8\u5206,\u8fd9\u91cc\u5c31\u4e0d\u518d\u91cd\u590d\u4e86.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u4e0b\uff1a \u65b9\u6cd5\u4e00\uff1a # \/etc\/init.d\/mysql stop # mysqld_safe &#038;#8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[178],"tags":[246],"_links":{"self":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/111"}],"collection":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":1,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":244,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions\/244"}],"wp:attachment":[{"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.huike007.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}