{"id":361,"date":"2011-07-22T10:07:52","date_gmt":"2011-07-22T10:07:52","guid":{"rendered":""},"modified":"2013-02-07T12:10:28","modified_gmt":"2013-02-07T04:10:28","slug":"mysql%e6%96%b0%e5%bb%ba%e7%94%a8%e6%88%b7%e6%9c%ac%e5%9c%b0%e6%97%a0%e6%b3%95%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"https:\/\/dingxuan.info\/wp\/?p=361","title":{"rendered":"mysql\u65b0\u5efa\u7528\u6237\u672c\u5730\u65e0\u6cd5\u767b\u5f55"},"content":{"rendered":"<p>\u56e0\u4e3aroot\u6743\u9650\u8fc7\u9ad8\uff0c\u6240\u4ee5\u65b0\u5efa\u4e00\u7528\u6237esojourn\uff0c\u6743\u9650\u4ec5\u4e3a\u8981\u7528\u5230\u7684\u6570\u636e\u5e93\u3002\u521b\u5efa\u8bed\u53e5\u5982\u4e0b\uff1agrant select,insert,update,delete on test.<em> to esojourn@&#8221;%&#8221; identified by &#8220;password&#8221;;\u5176\u4e2d@\u201c%\u201d\u662f\u53ef\u4ee5\u5728\u4efb\u4f55\u5730\u5740\u767b\u5f55\u3002 <br \/><br \/>\u521b\u5efa\u540e\u5230mysql.user\u4e0b\u67e5\u770b\uff0c\u6709\u8be5\u7528\u6237\u3002\u4f46\u662f\u4f7f\u7528mysql -u esojourn -ppassword \u767b\u5f55\uff0c\u63d0\u793a\u65e0\u6cd5\u767b\u5f55\uff1aERROR 1045 (28000): Access denied for user &#8216;esojourn&#8217;@&#8217;localhost&#8217; (using password: YES) <br \/>\u767e\u601d\u4e0d\u5f97\u5176\u89e3\uff0c\u9042google\uff0c\u5176\u4e2d\u6709\u4eba\u8bf4\u5230\u201cmysql.user \u8868\u4e2d\u6709\u53e6\u5916\u4e00\u4e9b\u8bb0\u5f55\u4ea7\u751f\u4e86\u4f5c\u7528\uff0c\u6700\u6709\u53ef\u80fd\u7684\u5c31\u662f\u5df2\u7ecf\u6709\u4e00\u6761&#8221;@localhost\u8bb0\u5f55\uff0c\u5c31\u662f\u7528\u6237\u540d\u662f\u7a7a\uff0c\u4e3b\u673a\u5b57\u6bb5\u662flocalhost\u7684\u8bb0\u5f55\u3002\u201d \u5f71\u54cd\u4e86\u3002\u67e5\u770b\u8be5\u8868\u679c\u7136\u6709\u3002 <br \/>mysql&gt; select host,user,password from mysql.user; <br \/>+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ <br \/>&#124; host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124; user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124; <br \/>+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ <br \/>&#124; localhost &#124; root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <\/em>81F5E21E35407D884A6CD4A731AEBFB6AF209E1B &#124; <br \/>&#124; esojourn.org&#124; root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <em>81F5E21E35407D884A6CD4A731AEBFB6AF209E1B &#124; <br \/>&#124; 127.0.0.1 &#124; root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <\/em>81F5E21E35407D884A6CD4A731AEBFB6AF209E1B &#124; <br \/>&#124; localhost &#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <br \/>&#124; esojourn.org&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#124;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <br \/>&#124; localhost &#124; debian-sys-maint &#124; <em>19DF6BF8310D46D681AE072AB73ECEC99C018C19 &#124; <br \/>&#124; %&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; esojourn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#124; <\/em>2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 &#124; <br \/>+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+ <br \/>7 rows in set (0.00 sec) <br \/>\u4f46\u662f\u5220\u9664\u90a3\u4e9b\u4e3a\u7a7a\uff08\u533f\u540d\uff09\u7684\u7528\u6237\u540e\u4ecd\u7136\u65e0\u6cd5\u767b\u5f55\u3002\uff08\u53ef\u80fd\u662f\u56e0\u4e3a\u6ca1\u6709\u91cd\u542fmysql\uff09\u4e8e\u662f\u53ea\u597d\u8010\u7740\u6027\u5b50\u770bmysql\u53c2\u8003\u624b\u518c\u3002\u53d1\u73b0\u5176\u4e2d\u589e\u52a0\u7528\u6237\u90e8\u5206\u6709\u8fd9\u4e48\u4e00\u6bb5\u8bdd\uff1a <br \/>\u5176\u4e2d\u4e24\u4e2a\u8d26\u6237\u6709\u76f8\u540c\u7684\u7528\u6237\u540dmonty\u548c\u5bc6\u7801some_pass\u3002\u4e24\u4e2a\u8d26\u6237\u5747\u4e3a\u8d85\u7ea7\u7528\u6237\u8d26\u6237\uff0c\u5177\u6709\u5b8c\u5168\u7684\u6743\u9650\u53ef\u4ee5\u505a\u4efb\u4f55\u4e8b\u60c5\u3002\u4e00\u4e2a\u8d26\u6237 (&#8216;monty&#8217;@&#8217;localhost&#8217;)\u53ea\u7528\u4e8e\u4ece\u672c\u673a\u8fde\u63a5\u65f6\u3002\u53e6\u4e00\u4e2a\u8d26\u6237(&#8216;monty&#8217;@&#8217;%&#8217;)\u53ef\u7528\u4e8e\u4ece\u5176\u5b83\u4e3b\u673a\u8fde\u63a5\u3002\u8bf7\u6ce8\u610fmonty\u7684\u4e24\u4e2a\u8d26\u6237\u5fc5\u987b\u80fd\u4ece\u4efb\u4f55\u4e3b\u673a\u4ee5monty\u8fde\u63a5\u3002\u6ca1\u6709localhost\u8d26\u6237\uff0c\u5f53monty\u4ece\u672c\u673a\u8fde\u63a5\u65f6\uff0cmysql_install_db\u521b\u5efa\u7684localhost\u7684\u533f\u540d\u7528\u6237\u8d26\u6237\u5c06\u5360\u5148\u3002\u7ed3\u679c\u662f\uff0cmonty\u5c06\u88ab\u89c6\u4e3a\u533f\u540d\u7528\u6237\u3002\u539f\u56e0\u662f\u533f\u540d\u7528\u6237\u8d26\u6237\u7684Host\u5217\u503c\u6bd4&#8217;monty&#8217;@&#8217;%&#8217;\u8d26\u6237\u66f4\u5177\u4f53\uff0c\u8fd9\u6837\u5728user\u8868\u6392\u5e8f\u987a\u5e8f\u4e2d\u6392\u5728\u524d\u9762\u3002 <br \/>\u8fd9\u6bb5\u8bdd\u8bf4\u7684\u5f88\u6e05\u695a\uff0c\u56e0\u6b64\u6267\u884c grant select,insert,update,delete on test.* to esojourn@&#8221;localhost&#8221; identified by &#8220;password&#8221;; <br \/>\u9000\u51fa\u540e\u7528esojourn\u767b\u5f55\uff0c\u6210\u529f\u3002<br \/><br \/>\u76f4\u63a5\u628aesojourn\u7684\u8d26\u6237\u4ece\u5168\u90e8\u4e3b\u673a\u6539\u6210localhost\u3002<br \/><br \/>\u8f6c\u81ea\uff1a<a href=\"http:\/\/anonymity.iteye.com\/blog\/347737\">http:\/\/anonymity.iteye.com\/blog\/347737<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3aroot\u6743\u9650\u8fc7\u9ad8\uff0c\u6240\u4ee5\u65b0\u5efa\u4e00\u7528\u6237esojourn\uff0c\u6743\u9650\u4ec5\u4e3a\u8981\u7528\u5230\u7684\u6570\u636e\u5e93\u3002\u521b\u5efa\u8bed\u53e5\u5982\u4e0b\uff1agrant sel &hellip; <a href=\"https:\/\/dingxuan.info\/wp\/?p=361\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">mysql\u65b0\u5efa\u7528\u6237\u672c\u5730\u65e0\u6cd5\u767b\u5f55<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[78,91],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-network","tag-linux","tag-mysql"],"_links":{"self":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=361"}],"version-history":[{"count":0,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions"}],"wp:attachment":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}