{"id":146,"date":"2018-03-21T12:56:07","date_gmt":"2018-03-21T04:56:07","guid":{"rendered":"http:\/\/kkong.net\/?p=146"},"modified":"2018-03-21T12:56:07","modified_gmt":"2018-03-21T04:56:07","slug":"%e9%87%8d%e7%bd%ae%e5%af%86%e7%a0%81%e8%a7%a3%e5%86%b3mysql-for-linux%e9%94%99%e8%af%af-error-1045-28000-using-password-yes","status":"publish","type":"post","link":"https:\/\/kkong.net\/?p=146","title":{"rendered":"\u91cd\u7f6e\u5bc6\u7801\u89e3\u51b3MySQL for Linux\u9519\u8bef ERROR 1045 (28000):  (using password: YES)"},"content":{"rendered":"<p>\u91cd\u7f6e\u5bc6\u7801\u89e3\u51b3MySQL for Linux\u9519\u8bef ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)<\/p>\n<p>\u4e00\u822c\u8fd9\u4e2a\u9519\u8bef\u662f\u7531\u5bc6\u7801\u9519\u8bef\u5f15\u8d77\uff0c\u89e3\u51b3\u7684\u529e\u6cd5\u81ea\u7136\u5c31\u662f\u91cd\u7f6e\u5bc6\u7801\u3002<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u4f7f\u7528\u7684\u662froot\u8d26\u6237\u3002<\/p>\n<p>1.\u91cd\u7f6e\u5bc6\u7801\u7684\u7b2c\u4e00\u6b65\u5c31\u662f\u8df3\u8fc7MySQL\u7684\u5bc6\u7801\u8ba4\u8bc1\u8fc7\u7a0b\uff0c\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>#vim \/etc\/my.cnf(\u6ce8\uff1awindows\u4e0b\u4fee\u6539\u7684\u662fmy.ini)<\/p>\n<p>\u5728\u6587\u6863\u5185\u641c\u7d22mysqld\u5b9a\u4f4d\u5230[mysqld]\u6587\u672c\u6bb5\uff1a<br \/>\n\/mysqld(\u5728vim\u7f16\u8f91\u72b6\u6001\u4e0b\u76f4\u63a5\u8f93\u5165\u8be5\u547d\u4ee4\u53ef\u641c\u7d22\u6587\u672c\u5185\u5bb9)<\/p>\n<p>\u5728[mysqld]\u540e\u9762\u4efb\u610f\u4e00\u884c\u6dfb\u52a0\u201cskip-grant-tables\u201d\u7528\u6765\u8df3\u8fc7\u5bc6\u7801\u9a8c\u8bc1\u7684\u8fc7\u7a0b.<\/p>\n<p>2.\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u91cd\u542fMySQL\uff1a<\/p>\n<p>\/etc\/init.d\/mysql restart(\u6709\u4e9b\u7528\u6237\u53ef\u80fd\u9700\u8981\u4f7f\u7528\/etc\/init.d\/mysqld restart)<\/p>\n<p>3.\u91cd\u542f\u4e4b\u540e\u8f93\u5165#mysql\u5373\u53ef\u8fdb\u5165mysql\u3002<\/p>\n<p>4.\u63a5\u4e0b\u6765\u5c31\u662f\u7528sql\u6765\u4fee\u6539root\u7684\u5bc6\u7801<\/p>\n<p>mysql&gt;\u00a0use\u00a0mysql;<br \/>\nmysql&gt;\u00a0update\u00a0user\u00a0set\u00a0password=password(\"\u4f60\u7684\u65b0\u5bc6\u7801\")\u00a0where\u00a0user=\"root\";<br \/>\nmysql&gt;\u00a0flush\u00a0privileges;<br \/>\nmysql&gt;\u00a0quit<\/p>\n<p>\u5230\u8fd9\u91ccroot\u8d26\u6237\u5c31\u5df2\u7ecf\u91cd\u7f6e\u6210\u65b0\u7684\u5bc6\u7801\u4e86\u3002<\/p>\n<p>5.\u7f16\u8f91my.cnf,\u53bb\u6389\u521a\u624d\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u7136\u540e\u91cd\u542fMySQL\u3002\u5927\u529f\u544a\u6210\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u7f6e\u5bc6\u7801\u89e3\u51b3MySQL for Linux\u9519\u8bef ERROR 1045 (28000): Access deni [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[18,17],"_links":{"self":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/146"}],"collection":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=146"}],"version-history":[{"count":1,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/kkong.net\/index.php?rest_route=\/wp\/v2\/posts\/146\/revisions\/147"}],"wp:attachment":[{"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kkong.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}