{"id":47,"date":"2010-07-21T20:40:07","date_gmt":"2010-07-21T20:40:07","guid":{"rendered":"https:\/\/shan.info\/new\/mysql%e6%b7%bb%e5%8a%a0%e6%96%b0%e7%94%a8%e6%88%b7%e5%92%8c%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e5%91%bd%e4%bb%a4%e8%a1%8c%e6%a8%a1%e5%bc%8f%e5%92%8cphpmyadmin%ef%bc%89\/"},"modified":"2010-07-21T20:40:07","modified_gmt":"2010-07-21T20:40:07","slug":"mysql%e6%b7%bb%e5%8a%a0%e6%96%b0%e7%94%a8%e6%88%b7%e5%92%8c%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e5%91%bd%e4%bb%a4%e8%a1%8c%e6%a8%a1%e5%bc%8f%e5%92%8cphpmyadmin%ef%bc%89","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/mysql%e6%b7%bb%e5%8a%a0%e6%96%b0%e7%94%a8%e6%88%b7%e5%92%8c%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%88%e5%91%bd%e4%bb%a4%e8%a1%8c%e6%a8%a1%e5%bc%8f%e5%92%8cphpmyadmin%ef%bc%89\/","title":{"rendered":"MYSQL\u6dfb\u52a0\u65b0\u7528\u6237\u548c\u6570\u636e\u5e93\uff08\u547d\u4ee4\u884c\u6a21\u5f0f\u548cphpmyadmin\uff09"},"content":{"rendered":"<div id=\"msgcns!750E812099FE2A7!196\" class=\"bvMsg\">\n<p>MYSQL\u6dfb\u52a0\u65b0\u7528\u6237\u548c\u6570\u636e\u5e93\uff08\u547d\u4ee4\u884c\u6a21\u5f0f\u548cphpmyadmin\uff09<\/p>\n<p>\u4e00\u3001\u547d\u4ee4\u884c\u6a21\u5f0f<\/p>\n<p>\u9996\u5148\u8981\u58f0\u660e\u4e00\u4e0b\uff1a\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4fee\u6539MySQL\u5bc6\u7801\uff0c\u6388\u6743\uff0c\u662f\u9700\u8981\u6709mysql\u91cc\u7684root\u6743\u9650\u7684\u3002<br \/>\u6ce8\uff1a\u672c\u64cd\u4f5c\u662f\u5728WIN\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\uff0cphpMyAdmin\u540c\u6837\u9002\u7528\u3002<br \/>\u7528\u6237\uff1aphplamp<br \/>\u7528\u6237\u6570\u636e\u5e93\uff1aphplampDB<\/p>\n<p>1.\u65b0\u5efa\u7528\u6237<\/p>\n<p>\/\/\u767b\u5f55MYSQL<br \/>@&gt;mysql -u root -p<br \/>@&gt;\u5bc6\u7801<br \/>\/\/\u521b\u5efa\u7528\u6237<br \/>mysql&gt; insert into mysql.user(Host,User,Password) values(&#8216;localhost&#8217;,&#8217;phplamp&#8217;,password(&#8216;1234&#8217;));<br \/>\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868<br \/>mysql&gt;flush privileges;<br \/>\u8fd9\u6837\u5c31\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\uff1aphplamp\u00a0 \u5bc6\u7801\u4e3a\uff1a1234\u00a0 \u7684\u7528\u6237\u3002<\/p>\n<p>\/\/\u9000\u51fa\u540e\u767b\u5f55\u4e00\u4e0b<br \/>mysql&gt;exit;<br \/>@&gt;mysql -u phplamp -p<br \/>@&gt;\u8f93\u5165\u5bc6\u7801<br \/>mysql&gt;\u767b\u5f55\u6210\u529f<\/p>\n<p>2.\u4e3a\u7528\u6237\u6388\u6743<\/p>\n<p>\/\/\u767b\u5f55MYSQL\uff08\u6709ROOT\u6743\u9650\uff09\u3002\u6211\u91cc\u6211\u4ee5ROOT\u8eab\u4efd\u767b\u5f55.<br \/>@&gt;mysql -u root -p<br \/>@&gt;\u5bc6\u7801<br \/>\/\/\u9996\u5148\u4e3a\u7528\u6237\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93(phplampDB)<br \/>mysql&gt;create database phplampDB;<br \/>\/\/\u6388\u6743phplamp\u7528\u6237\u62e5\u6709phplamp\u6570\u636e\u5e93\u7684\u6240\u6709\u6743\u9650<br \/>@&gt;grant all privileges on phplampDB.* to phplamp@localhost identified by &#8216;1234&#8217;;<br \/>\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868<br \/>mysql&gt;flush privileges;<br \/>mysql&gt;\u5176\u5b83\u64cd\u4f5c<\/p>\n<p>\/\/\u5982\u679c\u60f3\u6307\u5b9a\u90e8\u5206\u6743\u9650\u7ed9\u4e00\u7528\u6237\uff0c\u53ef\u4ee5\u8fd9\u6837\u6765\u5199:<br \/>mysql&gt;grant select,update on phplampDB.* to phplamp@localhost identified by &#8216;1234&#8217;;<br \/>\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868\u3002<br \/>mysql&gt;flush privileges;<\/p>\n<p>mysql&gt; grant \u6743\u96501,\u6743\u96502,\u2026\u6743\u9650n on \u6570\u636e\u5e93\u540d\u79f0.\u8868\u540d\u79f0 to \u7528\u6237\u540d@\u7528\u6237\u5730\u5740 identified by \u2018\u8fde\u63a5\u53e3\u4ee4\u2019;<\/p>\n<p>\u6743\u96501,\u6743\u96502,\u2026\u6743\u9650n\u4ee3\u8868select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file\u7b4914\u4e2a\u6743\u9650\u3002<br \/>\u5f53\u6743\u96501,\u6743\u96502,\u2026\u6743\u9650n\u88aball privileges\u6216\u8005all\u4ee3\u66ff\uff0c\u8868\u793a\u8d4b\u4e88\u7528\u6237\u5168\u90e8\u6743\u9650\u3002<br \/>\u5f53\u6570\u636e\u5e93\u540d\u79f0.\u8868\u540d\u79f0\u88ab*.*\u4ee3\u66ff\uff0c\u8868\u793a\u8d4b\u4e88\u7528\u6237\u64cd\u4f5c\u670d\u52a1\u5668\u4e0a\u6240\u6709\u6570\u636e\u5e93\u6240\u6709\u8868\u7684\u6743\u9650\u3002<br \/>\u7528\u6237\u5730\u5740\u53ef\u4ee5\u662flocalhost\uff0c\u4e5f\u53ef\u4ee5\u662fip\u5730\u5740\u3001\u673a\u5668\u540d\u5b57\u3001\u57df\u540d\u3002\u4e5f\u53ef\u4ee5\u7528\u2019%&#8217;\u8868\u793a\u4ece\u4efb\u4f55\u5730\u5740\u8fde\u63a5\u3002<br \/>\u2018\u8fde\u63a5\u53e3\u4ee4\u2019\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u5426\u5219\u521b\u5efa\u5931\u8d25\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<br \/>mysql&gt;grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by \u2018123\u2032;<br \/>\u7ed9\u6765\u81ea10.163.225.87\u7684\u7528\u6237joe\u5206\u914d\u53ef\u5bf9\u6570\u636e\u5e93vtdc\u7684employee\u8868\u8fdb\u884cselect,insert,update,delete,create,drop\u7b49\u64cd\u4f5c\u7684\u6743\u9650\uff0c\u5e76\u8bbe\u5b9a\u53e3\u4ee4\u4e3a123\u3002<\/p>\n<p>mysql&gt;grant all privileges on vtdc.* to joe@10.163.225.87 identified by \u2018123\u2032;<br \/>\u7ed9\u6765\u81ea10.163.225.87\u7684\u7528\u6237joe\u5206\u914d\u53ef\u5bf9\u6570\u636e\u5e93vtdc\u6240\u6709\u8868\u8fdb\u884c\u6240\u6709\u64cd\u4f5c\u7684\u6743\u9650\uff0c\u5e76\u8bbe\u5b9a\u53e3\u4ee4\u4e3a123\u3002<\/p>\n<p>mysql&gt;grant all privileges on *.* to joe@10.163.225.87 identified by \u2018123\u2032;<br \/>\u7ed9\u6765\u81ea10.163.225.87\u7684\u7528\u6237joe\u5206\u914d\u53ef\u5bf9\u6240\u6709\u6570\u636e\u5e93\u7684\u6240\u6709\u8868\u8fdb\u884c\u6240\u6709\u64cd\u4f5c\u7684\u6743\u9650\uff0c\u5e76\u8bbe\u5b9a\u53e3\u4ee4\u4e3a123\u3002<\/p>\n<p>mysql&gt;grant all privileges on *.* to joe@localhost identified by \u2018123\u2032;<br \/>\u7ed9\u672c\u673a\u7528\u6237joe\u5206\u914d\u53ef\u5bf9\u6240\u6709\u6570\u636e\u5e93\u7684\u6240\u6709\u8868\u8fdb\u884c\u6240\u6709\u64cd\u4f5c\u7684\u6743\u9650\uff0c\u5e76\u8bbe\u5b9a\u53e3\u4ee4\u4e3a123\u3002<\/p>\n<p>3.\u5220\u9664\u7528\u6237<\/p>\n<p>@&gt;mysql -u root -p<br \/>@&gt;\u5bc6\u7801<br \/>mysql&gt;DELETE FROM user WHERE User=&#8221;phplamp&#8221; and Host=&#8221;localhost&#8221;;<br \/>mysql&gt;flush privileges;<br \/>\/\/\u5220\u9664\u7528\u6237\u7684\u6570\u636e\u5e93<br \/>mysql&gt;drop database phplampDB;<\/p>\n<p>4.\u4fee\u6539\u6307\u5b9a\u7528\u6237\u5bc6\u7801<\/p>\n<p>@&gt;mysql -u root -p<br \/>@&gt;\u5bc6\u7801<br \/>mysql&gt;update mysql.user set password=password(&#8216;\u65b0\u5bc6\u7801&#8217;) where User=&#8221;phplamp&#8221; and Host=&#8221;localhost&#8221;;<br \/>mysql&gt;flush privileges;<br \/>mysql&gt;quit;<\/p>\n<p><span style=\"color: #ff0000;\">\u4e8c\u3001\u5229\u7528phpmyadmin<\/span><\/p>\n<p>1\u3001\u6210\u529f\u767b\u9646\u540e\u7684\u9996\u9875\u91cc\u586b\u5165\u65b0\u5efa\u7684\u6570\u636e\u5e93\u540d&#8221;sqlname&#8221;\uff0c\u70b9\u51fb\u201c\u521b\u5efa\u201d\u6765\u65b0\u5efa\u6570\u636e\u5e93\uff08\u5982\u679c\u521b\u5efa\u4e0d\u80fd\u6210\u529f\uff0c\u8bf4\u660e\u4f60\u6ca1\u6709\u7ba1\u7406\u6743\u9650\uff09<br \/>2\u3001\u7136\u540e\u70b9\u51fb\u5de6\u8fb9\u5de5\u5177\u680f\u4e0a\u90e8\u7684\u201c\u4e3b\u76ee\u5f55\u201d\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u8fb9\u680f\u91cc\u7684\u201c\u6743\u9650\u201d<br \/>3\u3001\u7136\u540e\u70b9\u51fb\u53f3\u8fb9\u680f\u91cc\u7684\u201c\u6dfb\u52a0\u65b0\u7528\u6237\u201d<br \/>4\u3001\u8f93\u5165\u6570\u636e\u5e93\u7528\u6237\u540dusername\u3001\u4e3b\u673a\u3001\u5bc6\u7801\u540e\uff0c\u70b9\u51fb\u4e0b\u90e8\u7684\u201c\u6267\u884c\u201d\uff08\u9664\u975e\u4f60\u6dfb\u52a0\u7684\u662f\u7ba1\u7406\u5458\uff0c\u5426\u5219\u65e0\u9700\u8bbe\u7f6e\u4e0b\u9762\u7684\u201c\u5168\u5c40\u6743\u9650\u201d\uff09\u3002<br \/>5\u3001\u7136\u540e\u5728\u201c\u6309\u6570\u636e\u5e93\u6307\u5b9a\u6743\u9650\u201d\u7684\u4e0b\u62c9\u6846\u4e2d\u627e\u5230\u521a\u624d\u6dfb\u52a0\u7684\u6570\u636e\u5e93&#8221;sqlname&#8221;\uff0c\u9009\u5b9a\u540e\u81ea\u52a8\u8df3\u8f6c\u5230\u4e0b\u4e00\u9875\u9762\u3002<br \/>6\u3001\u5728\u201c\u6309\u6570\u636e\u5e93\u6307\u5b9a\u6743\u9650\u201d\u91cc\u5168\u90e8\u70b9\u9009\uff0c\u70b9\u51fb\u201c\u6267\u884c\u201d\u786e\u5b9a\u3002<br \/>7\u3001\u4e0b\u4e00\u9875\u9762\u4e0a\u90e8\u51fa\u73b0\u4e86\u201c\u60a8\u5df2\u7ecf\u66f4\u65b0\u4e86&#8217;username&#8217;@&#8217;localhost&#8217;\u7684\u6743\u9650\u201d\u65f6\uff0c\u8bf4\u660e\u64cd\u4f5c\u6210\u529f\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MYSQL\u6dfb\u52a0\u65b0\u7528\u6237\u548c\u6570\u636e\u5e93\uff08\u547d\u4ee4\u884c\u6a21\u5f0f\u548cphpmyadmin\uff09 \u4e00\u3001\u547d\u4ee4\u884c\u6a21\u5f0f \u9996\u5148\u8981\u58f0\u660e\u4e00\u4e0b\uff1a\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4fee\u6539MySQL\u5bc6\u7801\uff0c\u6388\u6743\uff0c\u662f\u9700\u8981\u6709mysql\u91cc\u7684root\u6743\u9650\u7684\u3002\u6ce8\uff1a\u672c\u64cd\u4f5c\u662f\u5728WIN\u547d\u4ee4\u63d0\u793a\u7b26\u4e0b\uff0cphpMyAdmin\u540c\u6837\u9002\u7528\u3002\u7528\u6237\uff1aphplamp\u7528\u6237\u6570\u636e\u5e93\uff1aphplampDB 1.\u65b0\u5efa\u7528\u6237 \/\/\u767b\u5f55MYSQL@&gt;mysql -u root -p@&gt;\u5bc6\u7801\/\/\u521b\u5efa\u7528\u6237mysql&gt; insert into mysql.user(Host,User,Password) values(&#8216;localhost&#8217;,&#8217;phplamp&#8217;,password(&#8216;1234&#8217;));\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868mysql&gt;flush privileges;\u8fd9\u6837\u5c31\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\uff1aphplamp\u00a0 \u5bc6\u7801\u4e3a\uff1a1234\u00a0 \u7684\u7528\u6237\u3002 \/\/\u9000\u51fa\u540e\u767b\u5f55\u4e00\u4e0bmysql&gt;exit;@&gt;mysql -u phplamp -p@&gt;\u8f93\u5165\u5bc6\u7801mysql&gt;\u767b\u5f55\u6210\u529f 2.\u4e3a\u7528\u6237\u6388\u6743 \/\/\u767b\u5f55MYSQL\uff08\u6709ROOT\u6743\u9650\uff09\u3002\u6211\u91cc\u6211\u4ee5ROOT\u8eab\u4efd\u767b\u5f55.@&gt;mysql -u root -p@&gt;\u5bc6\u7801\/\/\u9996\u5148\u4e3a\u7528\u6237\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93(phplampDB)mysql&gt;create database phplampDB;\/\/\u6388\u6743phplamp\u7528\u6237\u62e5\u6709phplamp\u6570\u636e\u5e93\u7684\u6240\u6709\u6743\u9650@&gt;grant all privileges on phplampDB.* to phplamp@localhost identified by &#8216;1234&#8217;;\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868mysql&gt;flush privileges;mysql&gt;\u5176\u5b83\u64cd\u4f5c \/\/\u5982\u679c\u60f3\u6307\u5b9a\u90e8\u5206\u6743\u9650\u7ed9\u4e00\u7528\u6237\uff0c\u53ef\u4ee5\u8fd9\u6837\u6765\u5199:mysql&gt;grant select,update on phplampDB.* to phplamp@localhost identified by &#8216;1234&#8217;;\/\/\u5237\u65b0\u7cfb\u7edf\u6743\u9650\u8868\u3002mysql&gt;flush privileges; mysql&gt; grant \u6743\u96501,\u6743\u96502,\u2026\u6743\u9650n on \u6570\u636e\u5e93\u540d\u79f0.\u8868\u540d\u79f0 to \u7528\u6237\u540d@\u7528\u6237\u5730\u5740 identified by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-22"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}