{"id":384,"date":"2013-12-01T18:08:28","date_gmt":"2013-12-01T10:08:28","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=384"},"modified":"2015-09-02T07:33:22","modified_gmt":"2015-09-01T23:33:22","slug":"mysql%e5%ad%a6%e4%b9%a08-mysql5-1%e7%9a%84%e7%94%a8%e6%88%b7%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=384","title":{"rendered":"MySQL\u5b66\u4e608&#8211;MySQL5.1\u7684\u7528\u6237\u7ba1\u7406"},"content":{"rendered":"<div>\n<div>\u7528\u6237\u7ba1\u7406:\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2aaccount\u8bbf\u95ee\u548c\u63a7\u5236mysql\u670d\u52a1\u5668.\u5728MYSQL\u670d\u52a1\u5668\u4e2d,account\u5305\u542b\u4e24\u90e8\u5206,\u7528\u6237\u540d\u548c\u4e3b\u673a\u540d.\u4e5f\u5c31\u662f\u8bf4,\u5f53\u8fde\u63a5\u5230\u670d\u52a1\u5668\u65f6,\u9664\u4e86\u8981\u68c0\u67e5\u7528\u6237\u540d\u8fd8\u8981\u68c0\u67e5\u8fde\u63a5\u8fdb\u6765\u7684\u4e3b\u673a.\u4e00\u4e2a\u9690\u5f0f\u7684\u6982\u5ff5\u5c31\u662f\u8bf4\u7528\u6237\u540d\u76f8\u540c\u4f46\u662f\u4e3b\u673a\u540d\u4e0d\u540c\u7684account\u662f\u4e0d\u540c\u7684account;<\/div>\n<div><\/div>\n<div>Mysql\u53ef\u4ee5\u652f\u6301\u7684\u6743\u9650\u7c7b\u578b<\/div>\n<ol>\n<li>\u7ba1\u7406\u6743\u9650\n<ol>\n<li>CREATE TEMPORARY TABLES:\u521b\u5efa\u4e34\u65f6\u8868;<\/li>\n<li>CREATE USER:\u521b\u5efa\/\u5220\u9664\/\u91cd\u547d\u540d\u8d26\u6237;<\/li>\n<li><a>FILE:<\/a>\u5728sql\u8bed\u53e5\u4e2d\u8bfb\u5199\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6;<\/li>\n<li>LOCK TABLES:\u9501\u8868;<\/li>\n<li>PROCESS:\u67e5\u770b\u8fdb\u7a0b\u7684\u6d3b\u52a8\u72b6\u6001;<\/li>\n<li>RELOAD:\u91cd\u65b0\u52a0\u8f7d,FLUSH OR RESET;<\/li>\n<li>REPLICATION CLIENT:\u4f5c\u4e3a\u590d\u5236\u529f\u80fd\u7684\u4e3b\u673a;<\/li>\n<li>REPLICATION SLAVE:\u4f5c\u4e3a\u590d\u5236\u529f\u80fd\u7684\u5907\u673a;<\/li>\n<li>SHOW DATABASES:\u67e5\u770b\u6570\u636e\u5e93\u540d\u79f0;<\/li>\n<li>SHUTDOWN:\u5173\u95ed\u670d\u52a1\u5668;<\/li>\n<li>SUPER:\u5404\u79cd\u7ba1\u7406\u64cd\u4f5c;<\/li>\n<\/ol>\n<\/li>\n<li>\u6570\u636e\u8bbf\u95ee\u6743\u9650\n<ol>\n<li>ALTER:\u4fee\u6539\u8868\u7ed3\u6784,alter table;<\/li>\n<li>ALTER ROUTINE:\u4fee\u6539\u6216\u8005\u5220\u9664\u5b58\u50a8\u8fc7\u7a0b\u548c\u51fd\u6570;<\/li>\n<li>CREATE:\u521b\u5efa\u6570\u636e\u5e93\u6216\u8005\u8868;<\/li>\n<li>CREATE ROUTINE:\u521b\u5efa\u5b58\u50a8\u8fc7\u7a0b\u6216\u8005\u51fd\u6570;<\/li>\n<li>CREATE VIEW:\u521b\u5efa\u89c6\u56fe;<\/li>\n<li>DELETE:\u5220\u9664\u8868\u4e2d\u6570\u636e;<\/li>\n<li>DROP:\u5220\u9664\u6570\u636e\u5e93\u6216\u8005\u8868;<\/li>\n<li>EXECUTE:\u6267\u884c\u51fd\u6570\u6216\u8005\u8fc7\u7a0b;<\/li>\n<li>GRANT OPTION:\u6388\u6743\u7ed9\u5176\u5b83\u8d26\u6237;<\/li>\n<li>INDEX:\u521b\u5efa\/\u5220\u9664\u7d22\u5f15;<\/li>\n<li>INSERT:\u5411\u8868\u4e2d\u63d2\u5165\u8bb0\u5f55;<\/li>\n<li>SELECT:\u67e5\u8be2\u8868\u7684\u8bb0\u5f55;<\/li>\n<li>SHOW VIEW:\u67e5\u770b\u89c6\u56fe\u5b9a\u4e49,show create view;<\/li>\n<li>UPDATE:\u66f4\u65b0\u8868\u7684\u8bb0\u5f55:<\/li>\n<\/ol>\n<\/li>\n<li>\u7279\u6b8a\u7684\u6743\u9650\n<ol>\n<li>ALL and ALL PRIVILEGES:\u5373&#8217;all privileges except grant option&#8217;,\u6388\u4e88\u8d26\u6237\u9664\u4e86\u628a\u6743\u9650\u8d4b\u4e88\u5176\u5b83\u5e10\u53f7\u5916\u7684\u6240\u6709\u6743\u9650;<\/li>\n<li>USAGE:\u5373\u6ca1\u6709\u4efb\u4f55\u6743\u9650,\u4f46\u662f\u5b83\u53ef\u4ee5\u8fde\u63a5\u5230\u6570\u636e\u5e93\u4e0a,\u4e5f\u5728user\u8868\u4e2d\u751f\u6210\u4e00\u6761\u8bb0\u5f55.\u8fd9\u7c7b\u8d26\u6237\u7684\u5b58\u5728\u5c31\u662f\u4e3a\u4e86\u6267\u884c\u5411&#8217;show variables&#8217; or &#8216;show status&#8217;\u8fd9\u7c7b\u7684\u8bed\u53e5,\u4e5f\u4e0d\u80fd\u67e5\u770b\u8868\u7684\u5185\u5bb9;<\/li>\n<\/ol>\n<\/li>\n<li>\u6743\u9650\u7684\u7ea7\u522b\n<ol>\n<li>\u6240\u6709\u7684\u6743\u9650\u90fd\u53ef\u4ee5\u88ab\u6388\u4e88\u5168\u5c40\u7684,\u4e00\u4e2a\u8d26\u6237\u62e5\u6709\u5168\u5c40\u6743\u9650,\u5b83\u53ef\u4ee5\u5728\u4efb\u4f55\u6570\u636e\u5e93\u4efb\u4f55\u65f6\u95f4\u4f7f\u7528\u6b64\u6743\u9650.\u4e00\u822c\u53ea\u6388\u4e88\u7ba1\u7406\u5458\u8fd9\u6837\u7684\u6743\u9650;<\/li>\n<li>\u4e00\u4e9b\u6743\u9650\u53ef\u4ee5\u88ab\u6388\u4e88\u7279\u5b9a\u7684\u6570\u636e\u5e93:ALTER, CREATE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, GRANT OPTION, IDEX, INSERT, LOCK TABLES, SELECT, SHOW VIEW and UPDATE.\u4e00\u4e2a\u6570\u636e\u5e93\u7ea7\u522b\u7684\u6743\u9650\u53ef\u4ee5\u5e94\u7528\u4e8e\u6240\u6709\u7684tables\u548croutines;<\/li>\n<li>\u4e00\u4e9b\u6743\u9650\u53ef\u4ee5\u88ab\u6388\u4e88\u7279\u5b9a\u7684\u8868:ALERT, CREATE, DELETE, DROP, GRANT OPTION, INDEX, INSERT, SELECT and UPDATE.\u4e00\u4e2a\u6807\u8bb0\u522b\u7684\u6743\u9650\u53ef\u4ee5\u5e94\u7528\u4e8e\u8868\u4e2d\u6240\u6709\u7684\u5217;<\/li>\n<li>\u4e00\u4e9b\u6743\u9650\u53ef\u4ee5\u88ab\u6388\u4e88\u8868\u4e2d\u7684\u5217:INSERT, SELECT and UPDATE;<\/li>\n<li>\u4e00\u4e9b\u6743\u9650\u53ef\u4ee5\u88ab\u6388\u4e88\u51fd\u6570\u548c\u5b58\u50a8\u8fc7\u7a0b:EXECUTE, ALTER ROUTINE and GRANT OPTION;<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div><\/div>\n<div>\u6388\u6743\u8868<\/div>\n<ol>\n<li>\u5728mysql\u6570\u636e\u5e93\u4e2d\u6709\u51e0\u5f20\u6388\u6743\u8868\u5305\u542b\u4e86\u670d\u52a1\u5668\u5927\u90e8\u5206\u7684\u8bbf\u95ee\u63a7\u5236\u4fe1\u606f,\u5b83\u4eec\u5305\u542b\u4e86\u54ea\u4e9b\u662f\u5408\u6cd5\u7684\u8d26\u6237\u548c\u8fd9\u4e9b\u8d26\u6237\u62e5\u6709\u7684\u8bbf\u95ee\u7ea7\u522b\u7684\u4fe1\u606f;<\/li>\n<li>user:\u6bcf\u4e00\u4e2a\u8d26\u6237\u5728user\u8868\u5305\u542b\u4e00\u6761\u8bb0\u5f55,\u5b83\u8bb0\u5f55\u4e86\u7528\u6237\u62e5\u6709\u7684\u5168\u5c40\u7684\u6743\u9650,\u4e5f\u5305\u542b\u4e86\u4e00\u4e9b\u5176\u5b83\u4fe1\u606f,\u6bd4\u5982:\u4f7f\u7528\u8d44\u6e90\u7684\u9650\u5236,\u5ba2\u6237\u7aef\u8fde\u63a5\u8fdb\u6765\u662f\u5426\u9700\u8981\u4f7f\u7528SSL\u94fe\u63a5;<\/li>\n<li>db:\u5217\u51fa\u4e86\u8d26\u6237\u5bf9\u6307\u5b9a\u6570\u636e\u5e93\u7684\u6743\u9650;<\/li>\n<li>tables_priv:\u5217\u51fa\u4e86\u8d26\u6237\u5bf9\u6307\u5b9a\u8868\u7684\u6743\u9650;<\/li>\n<li>columns_priv:\u5217\u51fa\u4e86\u8d26\u6237\u5bf9\u6307\u5b9a\u5217\u7684\u6743\u9650;<\/li>\n<li>procs_priv:\u5217\u51fa\u4e86\u8d26\u6237\u5bf9\u5b58\u50a8\u8fc7\u7a0b\u548c\u51fd\u6570\u7684\u6743\u9650;<\/li>\n<li>\u670d\u52a1\u5668\u4f7f\u7528\u6388\u6743\u8868\u4e2d\u7684\u4fe1\u606f\u51b3\u5b9a\u662f\u5426\u5141\u8bb8\u5ba2\u6237\u7aef\u8fde\u63a5\u8fdb\u6765,\u4e5f\u51b3\u5b9a\u4e86\u5ba2\u6237\u7aef\u662f\u5426\u6709\u6743\u9650\u6267\u884c\u67d0\u4e9b\u8bed\u53e5,mysql\u670d\u52a1\u5668\u6bcf\u6b21\u542f\u52a8\u65f6\u90fd\u628a\u6388\u6743\u4fe1\u606f\u8f7d\u5165\u5230\u5185\u5b58,\u4ee5\u52a0\u5feb\u8bfb\u53d6\u6743\u9650\u7684\u901f\u5ea6,\u5728\u4e00\u4e0b\u4e24\u79cd\u60c5\u51b5\u4e0b\u4f1a\u5237\u65b0\u6743\u9650\u8868\u7684\u5185\u5b58\u62f7\u8d1d:\n<ol>\n<li>\u4f7f\u7528CREATE USER, GRANT, REVOKE or SET PASSWORD\u8bed\u53e5\u4fee\u6539\u78c1\u76d8\u4e0a\u7684\u8d26\u6237\u4fe1\u606f;<\/li>\n<li>\u4e5f\u53ef\u4ee5\u663e\u5f0f\u7684\u91cd\u65b0\u52a0\u8f7d\u8fd9\u4e9b\u8868\u4f7f\u7528<span style=\"color: #e30000;\">FLUSH PRIVILEGES<\/span>\u8bed\u53e5,\u6267\u884cmysqladmin flush-privileges or mysqladmin reload\u547d\u4ee4;<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div>\u7ba1\u7406\u7528\u6237<\/div>\n<ol>\n<li>\u67e5\u770b\u5f53\u524d\u7684\u7528\u6237:\n<ol>\n<li>select user();<\/li>\n<li>select current_user();<\/li>\n<li>show grants:\u67e5\u770b\u5f53\u524d\u7528\u6237\u6743\u9650\u4fe1\u606f;<\/li>\n<li>show grants for &#8216;user&#8217;@&#8217;host&#8217;:\u67e5\u770b\u67d0\u4e2a\u7528\u6237\u7684\u6743\u9650\u4fe1\u606f;<\/li>\n<li>show processlist:\u67e5\u770b\u5f53\u524d\u8fde\u63a5\u8fdb\u6765\u7528\u6237\u7684\u4fe1\u606f;<\/li>\n<\/ol>\n<\/li>\n<li>create user\u521b\u5efa\u4e00\u4e2a\u7528\u6237(\u53ef\u9009\u7684\u6307\u5b9a\u5bc6\u7801,\u4e0d\u6307\u5b9a\u7684\u8bdd\u4e3anull),\u8fd9\u4e2a\u8bed\u53e5\u5728user\u8868\u4e2d\u521b\u5efa\u4e00\u6761\u8bb0\u5f55.\u5b83\u6ca1\u6709\u6388\u4e88\u4efb\u4f55\u6743\u9650,\u53ef\u4ee5\u4e4b\u540e\u4f7f\u7528grant\u8bed\u53e5.eg:create user &#8216;user&#8217;@&#8217;host&#8217; identified by &#8216;password&#8217;;<\/li>\n<li>drop user\u56de\u6536\u4e00\u4e2a\u8d26\u6237\u7684\u6240\u6709\u6743\u9650,\u5e76\u4e14\u5220\u9664\u8fd9\u4e2a\u8d26\u6237.\u8fd9\u4f1a\u5220\u9664\u6240\u6709\u6388\u6743\u8868\u4e2d\u8ddf\u8fd9\u4e2a\u8d26\u6237\u6709\u5173\u7684\u4fe1\u606f,\u5982\u679c\u8981\u6536\u56de\u7528\u6237\u6743\u9650\u800c\u4e0d\u5220\u9664\u7528\u6237\u8981\u4f7f\u7528revoke\u8bed\u53e5.eg:drop user &#8216;user&#8217;@&#8217;host&#8217;;<\/li>\n<li>rename user\u6539\u53d8\u4e00\u4e2a\u73b0\u6709\u8d26\u6237\u7684\u7528\u90a3\u4e2a\u6237\u540d,\u53ef\u4ee5\u4fee\u6539\u7528\u6237\u540d\u6216\u8005\u4e3b\u673a\u540d\u7684\u4efb\u610f\u4e00\u90e8\u5206,\u6216\u8005\u4e24\u90e8\u5206\u90fd\u4fee\u6539.eg:rename user &#8216;user&#8217;@&#8217;host&#8217; to &#8216;user&#8217;@&#8217;host&#8217;;<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u533f\u540d\u8d26\u6237,\u4e0d\u9700\u8981\u7528\u6237\u540d\u548c\u5bc6\u7801\u5373\u53ef\u767b\u5f55,\u6bd4\u8f83\u5371\u9669.eg:insert into user(host, user, password) values(&#8216;%&#8217;, &#8221;, &#8221;);<\/li>\n<li>\u4fee\u6539\u7528\u6237\u7684\u5bc6\u7801:<span style=\"color: #e30000;\">set password for &#8216;u1&#8217;@&#8217;%&#8217;=password(&#8216;u1&#8217;);<\/span><\/li>\n<li>\u6388\u6743\u8bed\u53e5:grant privileges on objects to &#8216;user&#8217;@&#8217;host&#8217; identified by &#8216;password&#8217;;\n<ol>\n<li>on *.*:\u5168\u5c40\u6743\u9650,\u6240\u6709\u7684\u5bf9\u8c61,eg:grant all privileges on *.* to &#8216;u1&#8217;@&#8217;%&#8217; identified by &#8216;u1&#8217; with grant option;<\/li>\n<li>on db_name.*:\u5bf9\u6570\u636e\u5e93\u7684\u6743\u9650,eg:grant select, update on test.* to &#8216;u1&#8217;@&#8217;localhost&#8217;;<\/li>\n<li>on db_name.tbl_name:\u6570\u636e\u5e93\u4e2d\u8868\u7684\u6743\u9650,eg:grant select on mysql.user to &#8216;u1&#8217;@&#8217;localhost&#8217;;<\/li>\n<li>on db_name.tbl_name.col_name:\u6570\u636e\u5e93\u4e2d\u8868\u7684\u5217\u7684\u6743\u9650,eg:grant select(host, user) on mysql.user to &#8216;u1&#8217;@&#8217;%&#8217;;<\/li>\n<li>on db_name.routine_name:\u6570\u636e\u5e93\u4e2droutine\u7684\u6743\u9650;<\/li>\n<\/ol>\n<\/li>\n<li>\u8981\u6dfb\u52a0\u7528\u6237\u5e76\u6388\u6743\u4e00\u822c\u4f7f\u7528:grant \u6743\u96501,\u6743\u96502,&#8230; on \u6570\u636e\u5e93.\u8868 to &#8220;username&#8221;@&#8221;host&#8221; identified by &#8220;password&#8221;;(\u521b\u5efa\u7528\u6237\u7684\u540c\u65f6\u6388\u4e88\u6743\u9650)\n<ol>\n<li>grant all privileges on *.* to &#8220;user1&#8243;@&#8221;%&#8221; identified by &#8220;pwd&#8221;:\u8868\u793a\u5bf9user1\u6388\u4e88\u6240\u6709\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6240\u6709\u6743\u9650,\u5e76\u53ef\u4ee5\u4ece\u4efb\u610f\u5ba2\u6237\u7aef\u8fde\u63a5\u8fdb\u6765;<\/li>\n<li>grant select,insert,delete,update on mysql.user to &#8220;user1&#8243;@&#8221;192.168.0.1&#8221; identified by &#8220;pwd&#8221;:\u8868\u793a\u5bf9\u7528\u6237user1\u6388\u4e88mysql\u6570\u636e\u5e93\u7684user\u8868\u589e\u5220\u6539\u67e5\u6743\u9650,\u5e76\u4e14\u53ea\u80fd\u4ece192.168.0.1\u5ba2\u6237\u7aef\u8fde\u63a5\u8fdb\u6765;<\/li>\n<li>host\u5217\u4e3a%\u8868\u793a\u53ef\u4ee5\u4ece\u4efb\u610f\u7684\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u670d\u52a1\u5668\u7aef;<\/li>\n<li>\u4e00\u822c\u5728\u5f00\u53d1\u7684\u65f6\u5019\u4f7fhost\u4e3a%,\u5728\u751f\u4ea7\u73af\u5883\u4fee\u6539host\u7684\u5730\u5740;<\/li>\n<\/ol>\n<\/li>\n<li>\u56de\u6536\u6743\u9650:revoke prilileges on objects from &#8216;user&#8217;@&#8217;host&#8217;;\n<ol>\n<li>\u56de\u6536\u5168\u5c40\u6743\u9650:revoke all privileges, grant option from &#8216;u1&#8217;@&#8217;%&#8217;;<\/li>\n<li>\u56de\u6536\u6570\u636e\u5e93\u7684\u6743\u9650:revoke select, grant option on mysql.* from\u00a0&#8216;u1&#8217;@&#8217;%&#8217;;<\/li>\n<li>\u56de\u6536\u8868\u7684\u6743\u9650:revoke select on mysql.user\u00a0from &#8216;u1&#8217;@&#8217;%&#8217;;<\/li>\n<li>\u56de\u6536\u5217\u7684\u6743\u9650:revoke select(host, user) on mysql.user\u00a0from &#8216;u1&#8217;@&#8217;%&#8217;;<\/li>\n<\/ol>\n<\/li>\n<li>\u9650\u5236\u7528\u6237\u8d44\u6e90:\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5bf9\u5ba2\u6237\u7aef\u8fde\u8fdb\u6765\u7684\u6b21\u6570,\u67e5\u8be2\u6b21\u6570\u7b49\u8d44\u6e90\u6ca1\u6709\u9650\u5236,grant\u8bed\u53e5\u53ef\u4ee5\u5bf9\u8d26\u6237\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\u7684\u8d44\u6e90\u505a\u9650\u5236:\n<ol>\n<li>\u6bcf\u4e2a\u5c0f\u65f6\u5141\u8bb8\u8fde\u5230\u670d\u52a1\u5668\u7684\u6b21\u6570:max_connections;<\/li>\n<li>\u6bcf\u4e2a\u5c0f\u65f6\u5141\u8bb8\u67e5\u8be2\u7684\u6b21\u6570:max_questions;<\/li>\n<li>\u6bcf\u4e2a\u5c0f\u65f6\u5141\u8bb8\u66f4\u65b0\u7684\u6b21\u6570:max_updates;<\/li>\n<li>\u7528\u6237\u7684\u5e76\u53d1\u8fde\u63a5\u6570:max_user_connections;<\/li>\n<li>\u8bed\u53e5:grant all privileges on *.* to &#8216;u1&#8217;@&#8217;%&#8217; identified by &#8216;u1&#8217;\u00a0<span style=\"color: #e30000;\">with max_queries_per_hour 10 max_updates_per_hour 5 max_connections_per_hour 5 max_user_connections 8<\/span>;<\/li>\n<\/ol>\n<\/li>\n<li>\u5fd8\u8bb0\u7528\u6237\u5bc6\u7801\n<ol>\n<li>Linux\u4e2d\u7684\u5904\u7406\u65b9\u6cd5:\n<ol>\n<li>\u5173\u95ed\u670d\u52a1\u5668\u6216\u8005kill\u6389mysqld\u7684\u8fdb\u7a0b;<\/li>\n<li>\u4f7f\u7528&#8211;skip-grant-tables\u9009\u9879\u767b\u5f55,\u542f\u52a8\u670d\u52a1\u5668\u5e76\u8df3\u8fc7\u6388\u6743\u8868<\/li>\n<li>\u4f7f\u7528mysql\u767b\u5f55,\u53ef\u4ee5\u4e0d\u7528\u4f7f\u7528\u7528\u6237\u540d\u548c\u5bc6\u7801,\u5e76\u4e14\u6709\u5168\u90e8\u6743\u9650;<\/li>\n<li>\u767b\u5f55\u4e4b\u540e\u4fee\u6539\u5bc6\u7801(set password for\u00a0<a>u1@&#8217;%&#8217;=password(&#8216;pwd&#8217;)),\u6216\u8005\u76f4\u63a5\u66f4\u65b0mysql.user\u8868\u5bc6\u7801\u5b57\u6bb5\u4e3a\u7a7a\u5373\u53ef;<\/a><\/li>\n<\/ol>\n<\/li>\n<li>Windows\u4e2d\u7684\u5904\u7406\u65b9\u6cd5:\n<ol>\n<li>\u505c\u6b62mysql\u7684\u670d\u52a1:net stop mysql;<\/li>\n<li>\u5230mysql\u7684bin\u76ee\u5f55\u4e0b\u6267\u884cmysqld -nt &#8211;skip-grant-tables;<\/li>\n<li>\u5230\u65b0\u7684\u547d\u4ee4\u884c\u4e0b\u6267\u884cmysqladmin -uroot flush-privileges password &#8216;pwd&#8217;;<\/li>\n<li>\u7136\u540e\u5173\u95edmysql\u670d\u52a1:mysqladmin -uroot -p shutdown,\u6b64\u65f6\u8f93\u5165\u521a\u521a\u8bbe\u7f6e\u7684\u5bc6\u7801;<\/li>\n<li>\u542f\u52a8mysql\u670d\u52a1:net start mysql;<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u6237\u7ba1\u7406:\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2aaccount\u8bbf\u95ee\u548c\u63a7\u5236mysql\u670d\u52a1\u5668.\u5728MYSQL\u670d\u52a1\u5668\u4e2d,account\u5305\u542b\u4e24 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[27],"class_list":["post-384","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-mysql"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=384"}],"version-history":[{"count":0,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/384\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=384"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}