{"id":10884,"date":"2025-04-18T18:18:13","date_gmt":"2025-04-18T10:18:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/10884.html"},"modified":"2025-04-18T18:18:13","modified_gmt":"2025-04-18T10:18:13","slug":"%e8%bf%9e%e6%8e%a5%e6%9c%ac%e5%9c%b0%e5%92%8c%e6%9c%8d%e5%8a%a1%e5%99%a8-mysql-%e6%97%b6%e5%87%ba%e7%8e%b0-2003-cant-connect-to-mysql-server-on-localhost10061-%e9%94%99","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/10884.html","title":{"rendered":"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p>\u8fde\u63a5\u672c\u5730 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef&#xff0c;\u5982\u4f55\u89e3\u51b3&#xff1f;<\/p>\n<p>\u5728\u65e5\u5e38\u7684 MySQL \u5f00\u53d1\u6216\u8fd0\u7ef4\u4e2d&#xff0c;\u7ecf\u5e38\u4f1a\u9047\u5230\u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\u51fa\u73b0 2003 &#8211; Can&#039;t connect to MySQL server on &#039;localhost&#039; (10061) \u9519\u8bef\u3002\u8fd9\u7c7b\u95ee\u9898\u4e0d\u4ec5\u4ec5\u51fa\u73b0\u5728\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u6216 MySQL \u7248\u672c\u4e0b&#xff0c;\u4e5f\u53ef\u80fd\u7531\u591a\u79cd\u56e0\u7d20\u5bfc\u81f4\u3002\u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u6216\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6211\u4eec\u5c06\u4ece\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u3001MySQL \u7248\u672c\u3001\u914d\u7f6e\u95ee\u9898\u7b49\u591a\u4e2a\u7ef4\u5ea6\u8fdb\u884c\u8be6\u7ec6\u5206\u6790&#xff0c;\u5e76\u5217\u51fa\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848&#xff0c;\u5e76\u7ed9\u51fa\u5bf9\u5e94\u7684\u89e3\u51b3\u65b9\u6848\u4f18\u5148\u7ea7\u3002<\/p>\n<h3>\u4e00\u3001\u9519\u8bef\u539f\u56e0\u5206\u6790<\/h3>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u9700\u8981\u4e86\u89e3\u8be5\u9519\u8bef\u7684\u539f\u56e0\u30022003 &#8211; Can&#039;t connect to MySQL server on &#039;localhost&#039; (10061) \u9519\u8bef\u901a\u5e38\u8868\u660e\u5ba2\u6237\u7aef\u65e0\u6cd5\u5728\u6307\u5b9a\u7684\u7aef\u53e3\u4e0a\u4e0e MySQL \u670d\u52a1\u5efa\u7acb\u8fde\u63a5&#xff0c;\u53ef\u80fd\u7684\u539f\u56e0\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\n<p>MySQL \u670d\u52a1\u6ca1\u6709\u542f\u52a8\u6216\u5d29\u6e83\u3002<\/p>\n<\/li>\n<li>\n<p>\u9632\u706b\u5899\u963b\u6b62\u4e86\u7aef\u53e3\u8bbf\u95ee\u3002<\/p>\n<\/li>\n<li>\n<p>MySQL \u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u4e86\u9519\u8bef\u7684\u7ed1\u5b9a\u5730\u5740&#xff08;bind-address&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u5ba2\u6237\u7aef\u548c MySQL \u670d\u52a1\u5668\u4e4b\u95f4\u7684\u7f51\u7edc\u95ee\u9898\u3002<\/p>\n<\/li>\n<li>\n<p>MySQL \u7aef\u53e3\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u3002<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u5668\u4e0a\u7684\u67d0\u4e9b\u7f51\u7edc\u8bbe\u7f6e\u6216\u5b89\u5168\u7b56\u7565\u9650\u5236\u4e86\u8fde\u63a5\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101809-680226e15d03e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u4e00\u3001\u9519\u8bef\u539f\u56e0\u5206\u6790<\/li>\n<\/ul>\n<\/li>\n<li>\u4f5c\u8005\u7b80\u4ecb<\/li>\n<li>\n<ul>\n<li>\u732b\u5934\u864e\u662f\u8c01&#xff1f;<\/li>\n<li>\u4f5c\u8005\u540d\u7247 \u270d\ufe0f<\/li>\n<li>\u52a0\u5165\u6211\u4eecAI\u5171\u521b\u56e2\u961f &#x1f310;<\/li>\n<li>\u52a0\u5165\u732b\u5934\u864e\u7684\u5171\u521b\u5708&#xff0c;\u4e00\u8d77\u63a2\u7d22\u7f16\u7a0b\u4e16\u754c\u7684\u65e0\u9650\u53ef\u80fd&#xff01; &#x1f680;<\/li>\n<\/ul>\n<\/li>\n<li>\u6b63\u6587<\/li>\n<li>\n<ul>\n<li>\u4e8c\u3001MySQL \u7248\u672c\u5206\u6790<\/li>\n<li>\n<ul>\n<li>1. MySQL 5.7<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>2. MySQL 8<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u64cd\u4f5c\u7cfb\u7edf\u5206\u6790&#xff08;\u8be6\u7ec6\u7248&#xff09;<\/li>\n<li>\n<ul>\n<li>1. Windows 10<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>2. Windows 11<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>3. Linux&#xff08;\u4f8b\u5982 Ubuntu&#xff09;<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>4. macOS<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>5. Ubuntu&#xff08;\u8be6\u7ec6\u7248&#xff09;<\/li>\n<li>\n<ul>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/li>\n<li>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/li>\n<\/ul>\n<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u7c89\u4e1d\u798f\u5229<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>\u8054\u7cfb\u6211\u4e0e\u7248\u6743\u58f0\u660e &#x1f4e9;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4f5c\u8005\u7b80\u4ecb<\/h2>\n<h3>\u732b\u5934\u864e\u662f\u8c01&#xff1f;<\/h3>\n<p>\u5927\u5bb6\u597d&#xff0c;\u6211\u662f <font face=\"\u4eff\u5b8b\" color=\"red\" size=\"5\">\u732b\u5934\u864e<\/font>&#xff0c;\u732b\u5934\u864e\u6280\u672f\u56e2\u961f\u521b\u59cb\u4eba&#xff0c;\u4e5f\u88ab\u5927\u5bb6\u79f0\u4e3a<font face=\"\u6977\u4f53\" color=\"red\" size=\"5\">\u732b\u54e5<\/font>\u3002\u6211\u76ee\u524d\u662f<font face=\"\u4eff\u5b8b\" color=\"blue\" size=\"4\">COC\u5317\u4eac\u57ce\u5e02\u5f00\u53d1\u8005\u793e\u533a\u4e3b\u7406\u4eba<\/font>\u3001<font face=\"\u4eff\u5b8b\" color=\"blue\" size=\"4\">COC\u897f\u5b89\u57ce\u5e02\u5f00\u53d1\u8005\u793e\u533a\u4e3b\u7406\u4eba<\/font>&#xff0c;\u4ee5\u53ca<font face=\"\u4eff\u5b8b\" color=\"blue\" size=\"4\">\u4e91\u539f\u751f\u5f00\u53d1\u8005\u793e\u533a\u4e3b\u7406\u4eba<\/font>&#xff0c;\u5728\u591a\u4e2a\u6280\u672f\u9886\u57df\u5982<font face=\"courier New\" color=\"blue\" size=\"4\">\u4e91\u539f\u751f\u3001\u524d\u7aef\u3001\u540e\u7aef\u3001\u8fd0\u7ef4\u548cAI<\/font>\u90fd\u5177\u5907\u4e30\u5bcc\u7ecf\u9a8c\u3002<\/p>\n<p>\u6211\u7684\u535a\u5ba2\u5185\u5bb9\u6db5\u76d6\u5e7f\u6cdb&#xff0c;\u4e3b\u8981\u5206\u4eab<font face=\"\u6977\u4f53\" color=\"#32CD32\" size=\"4\">\u6280\u672f\u6559\u7a0b\u3001Bug\u89e3\u51b3\u65b9\u6848\u3001\u5f00\u53d1\u5de5\u5177\u4f7f\u7528\u65b9\u6cd5\u3001\u524d\u6cbf\u79d1\u6280\u8d44\u8baf\u3001\u4ea7\u54c1\u8bc4\u6d4b\u3001\u4ea7\u54c1\u4f7f\u7528\u4f53\u9a8c<\/font>&#xff0c;\u4ee5\u53ca<font face=\"\u6977\u4f53\" color=\"#32CD32\" size=\"4\">\u4ea7\u54c1\u4f18\u7f3a\u70b9\u5206\u6790\u3001\u6a2a\u5411\u5bf9\u6bd4\u3001\u6280\u672f\u6c99\u9f99\u53c2\u4f1a\u4f53\u9a8c<\/font>\u7b49\u3002\u6211\u7684\u5206\u4eab\u805a\u7126\u4e8e<font face=\"\u6977\u4f53\" color=\"#20B2AA\" size=\"4\">\u4e91\u670d\u52a1\u4ea7\u54c1\u8bc4\u6d4b\u3001AI\u4ea7\u54c1\u5bf9\u6bd4\u3001\u5f00\u53d1\u677f\u6027\u80fd\u6d4b\u8bd5\u548c\u6280\u672f\u62a5\u544a<\/font>\u3002<\/p>\n<p>\u76ee\u524d&#xff0c;\u6211\u6d3b\u8dc3\u5728<font face=\"courier New\" color=\"#FF69B4\" size=\"4\">CSDN\u300151CTO\u3001\u817e\u8baf\u4e91\u3001\u963f\u91cc\u4e91\u5f00\u53d1\u8005\u793e\u533a\u3001\u77e5\u4e4e\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u89c6\u9891\u53f7\u3001\u6296\u97f3\u3001B\u7ad9\u3001\u5c0f\u7ea2\u4e66<\/font>\u7b49\u5e73\u53f0&#xff0c;\u5168\u7f51\u7c89\u4e1d\u5df2\u8d85\u8fc7<font face=\"\u4eff\u5b8b\" color=\"#8A2BE2\" size=\"4\">30\u4e07<\/font>\u3002\u6211\u6240\u6709\u5e73\u53f0\u7684IP\u540d\u79f0\u7edf\u4e00\u4e3a<font face=\"\u6977\u4f53\" color=\"red\" size=\"4\">\u732b\u5934\u864e<\/font>\u6216<font face=\"courier New\" color=\"red\" size=\"4\">\u732b\u5934\u864e\u6280\u672f\u56e2\u961f<\/font>\u3002<\/p>\n<p>\u6211\u5e0c\u671b\u901a\u8fc7\u6211\u7684\u5206\u4eab&#xff0c;\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u5730\u638c\u63e1\u548c\u4f7f\u7528\u5404\u79cd\u6280\u672f\u4ea7\u54c1&#xff0c;\u63d0\u5347\u5f00\u53d1\u6548\u7387\u4e0e\u4f53\u9a8c\u3002<\/p>\n<hr \/>\n<h3>\u4f5c\u8005\u540d\u7247 \u270d\ufe0f<\/h3>\n<ul>\n<li>\u535a\u4e3b&#xff1a;<font face=\"\u4eff\u5b8b\" color=\"red\" size=\"4\">\u732b\u5934\u864e<\/font><\/li>\n<li>\u5168\u7f51\u641c\u7d22\u5173\u952e\u8bcd&#xff1a;<font face=\"\u6977\u4f53\" color=\"#1E90FF\" size=\"4\">\u732b\u5934\u864e<\/font><\/li>\n<li>\u4f5c\u8005\u5fae\u4fe1\u53f7&#xff1a;<font face=\"courier New\" color=\"#FF4500\" size=\"4\">Libin9iOak<\/font><\/li>\n<li>\u4f5c\u8005\u516c\u4f17\u53f7&#xff1a;<font face=\"\u6977\u4f53\" color=\"#32CD32\" size=\"4\">\u732b\u5934\u864e\u6280\u672f\u56e2\u961f<\/font><\/li>\n<li>\u66f4\u65b0\u65e5\u671f&#xff1a;<font face=\"\u4eff\u5b8b\" color=\"#FFD700\" size=\"4\">2025\u5e7403\u670821\u65e5<\/font><\/li>\n<li>&#x1f31f; \u6b22\u8fce\u6765\u5230\u732b\u5934\u864e\u7684\u535a\u5ba2 \u2014 \u63a2\u7d22\u6280\u672f\u7684\u65e0\u9650\u53ef\u80fd&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h3>\u52a0\u5165\u6211\u4eecAI\u5171\u521b\u56e2\u961f &#x1f310;<\/h3>\n<ul>\n<li>\u732b\u5934\u864eAI\u5171\u521b\u793e\u7fa4\u77e9\u9635\u5217\u8868&#xff1a;\n<ul>\n<li><font face=\"courier New\" color=\"blue\" size=\"5\">\u70b9\u6211\u8fdb\u5165\u5171\u521b\u793e\u7fa4\u77e9\u9635\u5165\u53e3<\/font><\/li>\n<li><font face=\"\u4eff\u5b8b\" color=\"green\" size=\"5\">\u70b9\u6211\u8fdb\u5165\u65b0\u77e9\u9635\u5907\u7528\u94fe\u63a5\u5165\u53e3<\/font><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u52a0\u5165\u732b\u5934\u864e\u7684\u5171\u521b\u5708&#xff0c;\u4e00\u8d77\u63a2\u7d22\u7f16\u7a0b\u4e16\u754c\u7684\u65e0\u9650\u53ef\u80fd&#xff01; &#x1f680;<\/h3>\n<p>\u90e8\u5206\u4e13\u680f\u94fe\u63a5&#xff1a;<\/p>\n<p>&#x1f517; \u7cbe\u9009\u4e13\u680f&#xff1a;<\/p>\n<ul>\n<li>\u300a\u9762\u8bd5\u9898\u5927\u5168\u300b \u2014 \u9762\u8bd5\u51c6\u5907\u7684\u5b9d\u5178&#xff01;<\/li>\n<li>\u300aIDEA\u5f00\u53d1\u79d8\u7c4d\u300b \u2014 \u63d0\u5347\u4f60\u7684IDEA\u6280\u80fd&#xff01;<\/li>\n<li>\u300a100\u5929\u7cbe\u901a\u9e3f\u8499\u300b \u2014 \u4eceWeb\/\u5b89\u5353\u5230\u9e3f\u8499\u5927\u5e08&#xff01;<\/li>\n<li>\u300a100\u5929\u7cbe\u901aGolang&#xff08;\u57fa\u7840\u5165\u95e8\u7bc7&#xff09;\u300b \u2014 \u8e0f\u5165Go\u8bed\u8a00\u4e16\u754c\u7684\u7b2c\u4e00\u6b65&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101809-680226e18a8a6.png\" alt=\"\u732b\u5934\u864e\u5206\u4eabNo bug\" \/><\/p>\n<h2>\u6b63\u6587<\/h2>\n<h3>\u4e8c\u3001MySQL \u7248\u672c\u5206\u6790<\/h3>\n<h4>1. MySQL 5.7<\/h4>\n<p>MySQL 5.7 \u662f\u4e00\u4e2a\u6bd4\u8f83\u7a33\u5b9a\u7684\u7248\u672c&#xff0c;\u4f46\u5728\u5b89\u88c5\u548c\u914d\u7f6e\u8fc7\u7a0b\u4e2d&#xff0c;\u5982\u679c\u6ca1\u6709\u6b63\u786e\u914d\u7f6e\u67d0\u4e9b\u9009\u9879&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230 2003 \u9519\u8bef\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u68c0\u67e5 MySQL \u670d\u52a1\u662f\u5426\u542f\u52a8&#xff1a;\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b MySQL \u670d\u52a1\u662f\u5426\u6b63\u5e38\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">service<\/span> mysql status<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u542f\u52a8&#xff0c;\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">service<\/span> mysql start\n <\/li>\n<li>\n<p>\u68c0\u67e5 bind-address \u8bbe\u7f6e&#xff1a;MySQL 5.7 \u9ed8\u8ba4\u53ef\u80fd\u5c06 bind-address \u8bbe\u7f6e\u4e3a 127.0.0.1&#xff0c;\u5982\u679c\u4f60\u7684 MySQL \u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6&#xff08;my.cnf \u6216 my.ini&#xff09;\u4e2d bind-address \u4e3a 0.0.0.0 \u6216\u6b63\u786e\u8bbe\u7f6e\u4e3a localhost&#xff0c;\u786e\u4fdd\u5b83\u6ca1\u6709\u88ab\u9519\u8bef\u914d\u7f6e\u4e3a\u67d0\u4e2a\u4e0d\u6b63\u786e\u7684\u5730\u5740&#xff1a;<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u67e5\u770b\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;\u68c0\u67e5\u9632\u706b\u5899\u662f\u5426\u963b\u6b62\u4e86 MySQL \u7684\u7aef\u53e3&#xff08;\u9ed8\u8ba4\u4e3a 3306&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw allow <span class=\"token number\">3306<\/span>\n <\/li>\n<li>\n<p>MySQL \u7528\u6237\u6743\u9650&#xff1a;\u786e\u4fdd MySQL \u7528\u6237\u5177\u6709\u4ece localhost \u8fde\u63a5\u7684\u6743\u9650\u3002\u5982\u679c\u9700\u8981&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6388\u4e88\u6743\u9650&#xff1a;<\/p>\n<p> <span class=\"token keyword\">GRANT<\/span> <span class=\"token keyword\">ALL<\/span> <span class=\"token keyword\">PRIVILEGES<\/span> <span class=\"token keyword\">ON<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">.<\/span><span class=\"token operator\">*<\/span> <span class=\"token keyword\">TO<\/span> <span class=\"token string\">&#039;root&#039;<\/span><span class=\"token variable\">&#064;&#039;localhost&#039;<\/span> IDENTIFIED <span class=\"token keyword\">BY<\/span> <span class=\"token string\">&#039;password&#039;<\/span><span class=\"token punctuation\">;<\/span>\n <\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<h4>2. MySQL 8<\/h4>\n<p>MySQL 8 \u5f15\u5165\u4e86\u4e00\u4e9b\u65b0\u7279\u6027\u548c\u53d8\u5316&#xff0c;\u4f8b\u5982\u6539\u8fdb\u7684\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6\u548c\u66f4\u4e25\u683c\u7684\u5b89\u5168\u8bbe\u7f6e&#xff0c;\u8fd9\u53ef\u80fd\u4f1a\u5f71\u54cd\u8fde\u63a5\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u68c0\u67e5\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6&#xff1a;MySQL 8 \u9ed8\u8ba4\u4f7f\u7528 caching_sha2_password \u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6&#xff0c;\u8f83\u65e7\u7684\u5ba2\u6237\u7aef\u53ef\u80fd\u4e0d\u652f\u6301\u6b64\u63d2\u4ef6\u3002\u53ef\u4ee5\u5728 my.cnf \u6587\u4ef6\u4e2d\u5c06\u9ed8\u8ba4\u7684\u8eab\u4efd\u9a8c\u8bc1\u63d2\u4ef6\u66f4\u6539\u4e3a mysql_native_password&#xff0c;\u4ee5\u4fbf\u652f\u6301\u65e7\u5ba2\u6237\u7aef&#xff1a;<\/p>\n<p> default_authentication_plugin &#061; mysql_native_password\n <\/li>\n<li>\n<p>\u9632\u706b\u5899\u548c\u7aef\u53e3\u68c0\u67e5&#xff1a;\u540c MySQL 5.7 \u7684\u89e3\u51b3\u65b9\u6cd5&#xff0c;\u786e\u4fdd\u9632\u706b\u5899\u672a\u963b\u6b62 3306 \u7aef\u53e3\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6&#xff1a;\u786e\u4fdd bind-address \u8bbe\u7f6e\u6b63\u786e&#xff0c;\u5e76\u4e14\u6ca1\u6709\u88ab\u4e0d\u5c0f\u5fc3\u4fee\u6539\u4e3a 0.0.0.0\u3002<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u68c0\u67e5\u7528\u6237\u6743\u9650&#xff1a;\u4f7f\u7528\u4ee5\u4e0b SQL \u8bed\u53e5\u6765\u786e\u4fdd MySQL \u7528\u6237\u53ef\u4ee5\u4ece\u672c\u5730\u8fde\u63a5&#xff1a;<\/p>\n<p> <span class=\"token keyword\">GRANT<\/span> <span class=\"token keyword\">ALL<\/span> <span class=\"token keyword\">PRIVILEGES<\/span> <span class=\"token keyword\">ON<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">.<\/span><span class=\"token operator\">*<\/span> <span class=\"token keyword\">TO<\/span> <span class=\"token string\">&#039;root&#039;<\/span><span class=\"token variable\">&#064;&#039;localhost&#039;<\/span> IDENTIFIED <span class=\"token keyword\">BY<\/span> <span class=\"token string\">&#039;password&#039;<\/span><span class=\"token punctuation\">;<\/span>\n <\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<hr \/>\n<h3>\u4e09\u3001\u64cd\u4f5c\u7cfb\u7edf\u5206\u6790&#xff08;\u8be6\u7ec6\u7248&#xff09;<\/h3>\n<p>\u8fde\u63a5 MySQL \u65f6\u51fa\u73b0 2003 &#8211; Can&#039;t connect to MySQL server on &#039;localhost&#039; (10061) \u9519\u8bef&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u662f\u4e00\u4e2a\u91cd\u8981\u7684\u56e0\u7d20&#xff0c;\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u53ef\u80fd\u4f1a\u5bf9 MySQL \u670d\u52a1\u7684\u8fd0\u884c\u4ea7\u751f\u4e0d\u540c\u5f71\u54cd\u3002\u6211\u4eec\u5c06\u5206\u522b\u8be6\u7ec6\u5206\u6790 Windows 10\u3001Windows 11\u3001Linux\u3001macOS \u548c Ubuntu \u7b49\u5e38\u89c1\u64cd\u4f5c\u7cfb\u7edf\u7684\u76f8\u5173\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<h4>1. Windows 10<\/h4>\n<p>\u5728 Windows 10 \u4e0a&#xff0c;MySQL \u53ef\u80fd\u4f1a\u56e0\u4e3a\u670d\u52a1\u672a\u542f\u52a8\u3001\u9632\u706b\u5899\u963b\u6321\u3001\u7aef\u53e3\u5360\u7528\u6216\u6743\u9650\u95ee\u9898\u7b49\u5bfc\u81f4 2003 \u9519\u8bef\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u9010\u6b65\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u786e\u8ba4 MySQL \u670d\u52a1\u662f\u5426\u542f\u52a8&#xff1a;<\/p>\n<p>\u5728 Windows \u4e0a\u8fd0\u884c MySQL \u670d\u52a1\u5668\u901a\u5e38\u662f\u901a\u8fc7\u670d\u52a1\u7ba1\u7406\u6765\u63a7\u5236\u7684\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5 MySQL \u670d\u52a1\u662f\u5426\u6b63\u5728\u8fd0\u884c&#xff1a;<\/p>\n<li>\u6253\u5f00\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d&#xff0c;\u5207\u6362\u5230\u201c\u670d\u52a1\u201d\u6807\u7b7e&#xff0c;\u67e5\u770b MySQL \u670d\u52a1\u7684\u72b6\u6001\u3002<\/li>\n<li>\u5982\u679c MySQL \u6ca1\u6709\u542f\u52a8&#xff0c;\u53ef\u4ee5\u624b\u52a8\u542f\u52a8\u5b83\u3002\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u5e76\u8f93\u5165&#xff1a;net start MySQL\n <\/li>\n<\/li>\n<li>\n<p>\u68c0\u67e5 MySQL \u914d\u7f6e\u6587\u4ef6&#xff1a; \u786e\u4fdd MySQL \u7684\u914d\u7f6e\u6587\u4ef6 my.ini \u4e2d\u6ca1\u6709\u5c06 bind-address \u9519\u8bef\u914d\u7f6e\u4e3a\u9664 127.0.0.1 \u6216 localhost \u4e4b\u5916\u7684\u5176\u4ed6\u5730\u5740\u3002\u6b63\u786e\u914d\u7f6e bind-address \u53ef\u4ee5\u9632\u6b62 MySQL \u88ab\u5916\u90e8\u7f51\u7edc\u8bbf\u95ee&#xff1a;<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;<\/p>\n<p>Windows \u9632\u706b\u5899\u53ef\u80fd\u963b\u6b62\u4e86 MySQL \u7684\u9ed8\u8ba4\u7aef\u53e3 3306\u3002\u53ef\u4ee5\u5728\u9632\u706b\u5899\u4e2d\u521b\u5efa\u89c4\u5219\u5141\u8bb8 MySQL \u7aef\u53e3\u7684\u6d41\u91cf&#xff1a;<\/p>\n<li>\u6253\u5f00\u63a7\u5236\u9762\u677f -&gt; \u7cfb\u7edf\u548c\u5b89\u5168 -&gt; Windows \u9632\u706b\u5899 -&gt; \u9ad8\u7ea7\u8bbe\u7f6e -&gt; \u5165\u7ad9\u89c4\u5219\u3002<\/li>\n<li>\u65b0\u5efa\u5165\u7ad9\u89c4\u5219&#xff0c;\u9009\u62e9\u7aef\u53e3&#xff0c;\u6307\u5b9a\u7aef\u53e3\u53f7 3306&#xff0c;\u5e76\u5141\u8bb8\u8fde\u63a5\u3002<\/li>\n<\/li>\n<li>\n<p>\u68c0\u67e5 MySQL \u7528\u6237\u6743\u9650&#xff1a;<\/p>\n<p>\u5728 MySQL \u4e2d&#xff0c;\u7528\u6237\u6743\u9650\u7684\u914d\u7f6e\u4e5f\u53ef\u80fd\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u3002\u786e\u4fdd\u4f60\u4f7f\u7528\u7684\u6570\u636e\u5e93\u7528\u6237\u62e5\u6709\u4ece localhost \u8fde\u63a5\u7684\u6743\u9650&#xff1a;<\/p>\n<p> <span class=\"token keyword\">GRANT<\/span> <span class=\"token keyword\">ALL<\/span> <span class=\"token keyword\">PRIVILEGES<\/span> <span class=\"token keyword\">ON<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">.<\/span><span class=\"token operator\">*<\/span> <span class=\"token keyword\">TO<\/span> <span class=\"token string\">&#039;root&#039;<\/span><span class=\"token variable\">&#064;&#039;localhost&#039;<\/span> IDENTIFIED <span class=\"token keyword\">BY<\/span> <span class=\"token string\">&#039;password&#039;<\/span><span class=\"token punctuation\">;<\/span><br \/>\nFLUSH <span class=\"token keyword\">PRIVILEGES<\/span><span class=\"token punctuation\">;<\/span>\n <\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<h4>2. Windows 11<\/h4>\n<p>\u4e0e Windows 10 \u76f8\u6bd4&#xff0c;Windows 11 \u5728\u7f51\u7edc\u5b89\u5168\u548c\u9632\u706b\u5899\u7b56\u7565\u65b9\u9762\u53ef\u80fd\u4f1a\u6709\u4e00\u4e9b\u65b0\u7684\u8bbe\u7f6e&#xff0c;\u5bfc\u81f4 MySQL \u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u6216\u8fde\u63a5\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u7981\u7528 Windows \u9632\u706b\u5899&#xff1a;<\/p>\n<p>\u5728\u6392\u67e5\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u65f6&#xff0c;\u6682\u65f6\u7981\u7528\u9632\u706b\u5899\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u6392\u9664\u6cd5\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u7981\u7528\u9632\u706b\u5899&#xff1a;<\/p>\n<p> netsh advfirewall set allprofiles state off<\/p>\n<p>\u4f46\u5efa\u8bae\u5728\u786e\u8ba4\u95ee\u9898\u540e\u91cd\u65b0\u542f\u7528\u9632\u706b\u5899&#xff0c;\u5e76\u9002\u5f53\u914d\u7f6e\u9632\u706b\u5899\u89c4\u5219\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u670d\u52a1\u542f\u52a8\u72b6\u6001&#xff1a;<\/p>\n<p>\u6253\u5f00\u201c\u4efb\u52a1\u7ba1\u7406\u5668\u201d&#xff0c;\u786e\u8ba4 MySQL \u670d\u52a1\u662f\u5426\u8fd0\u884c\u3002\u5982\u679c MySQL \u6ca1\u6709\u8fd0\u884c&#xff0c;\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4f7f\u7528&#xff1a;<\/p>\n<p> net start MySQL\n <\/li>\n<li>\n<p>\u66f4\u65b0 MySQL \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>\u786e\u4fdd MySQL \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 bind-address \u8bbe\u7f6e\u6b63\u786e\u3002\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u8bbe\u7f6e\u5f3a\u5236 MySQL \u7ed1\u5b9a\u5230 localhost&#xff1a;<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u67e5\u770b MySQL \u9519\u8bef\u65e5\u5fd7&#xff1a;<\/p>\n<p>\u5982\u679c MySQL \u65e0\u6cd5\u542f\u52a8&#xff0c;\u67e5\u770b MySQL \u9519\u8bef\u65e5\u5fd7\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u9519\u8bef\u4fe1\u606f&#xff0c;\u65e5\u5fd7\u901a\u5e38\u4f4d\u4e8e C:\\\\ProgramData\\\\MySQL\\\\MySQL Server 8.0\\\\data\\\\ \u76ee\u5f55\u4e0b\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;<\/h5>\n<h4>3. Linux&#xff08;\u4f8b\u5982 Ubuntu&#xff09;<\/h4>\n<p>Linux \u7cfb\u7edf\u4e0a\u7684 MySQL \u670d\u52a1\u548c\u8fde\u63a5\u95ee\u9898\u901a\u5e38\u4e0e\u7528\u6237\u6743\u9650\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u670d\u52a1\u72b6\u6001\u4ee5\u53ca\u9632\u706b\u5899\u8bbe\u7f6e\u7b49\u6709\u5173\u3002\u6211\u4eec\u5c06\u5206\u522b\u8be6\u7ec6\u5217\u4e3e\u89e3\u51b3\u6b65\u9aa4\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u68c0\u67e5 MySQL \u670d\u52a1\u72b6\u6001&#xff1a;<\/p>\n<p>\u5728 Linux \u7cfb\u7edf\u4e0a&#xff0c;MySQL \u670d\u52a1\u901a\u5e38\u662f\u901a\u8fc7 systemd \u6216 init.d \u542f\u52a8\u7684\u3002\u9996\u5148&#xff0c;\u68c0\u67e5 MySQL \u670d\u52a1\u662f\u5426\u6b63\u5e38\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl status mysql<\/p>\n<p>\u5982\u679c\u670d\u52a1\u6ca1\u6709\u542f\u52a8&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl start mysql<\/p>\n<p>\u82e5\u8981\u8ba9 MySQL \u670d\u52a1\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> mysql\n <\/li>\n<li>\n<p>\u68c0\u67e5 MySQL \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>\u6253\u5f00 MySQL \u914d\u7f6e\u6587\u4ef6 \/etc\/mysql\/my.cnf \u6216 \/etc\/mysql\/mysql.conf.d\/mysqld.cnf&#xff0c;\u786e\u4fdd bind-address \u8bbe\u7f6e\u4e3a 127.0.0.1 \u6216 localhost&#xff0c;\u4ee5\u907f\u514d\u4ece\u5916\u90e8\u8bbf\u95ee&#xff1a;<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;<\/p>\n<p>\u5728 Ubuntu \u4e2d&#xff0c;\u9ed8\u8ba4\u7684\u9632\u706b\u5899\u662f ufw\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5 MySQL \u7aef\u53e3\u662f\u5426\u5f00\u653e&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw status<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u5f00\u653e 3306 \u7aef\u53e3&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5141\u8bb8\u8bbf\u95ee&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw allow <span class=\"token number\">3306<\/span><\/p>\n<p>\u5982\u679c\u4e0d\u4f7f\u7528 ufw&#xff0c;\u4e5f\u53ef\u4ee5\u4f7f\u7528 iptables \u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5 MySQL \u9519\u8bef\u65e5\u5fd7&#xff1a;<\/p>\n<p>\u67e5\u770b MySQL \u9519\u8bef\u65e5\u5fd7 \/var\/log\/mysql\/error.log \u6216 \/var\/log\/mysql\/mysql-error.log&#xff0c;\u786e\u8ba4\u662f\u5426\u6709\u9519\u8bef\u4fe1\u606f&#xff0c;\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u7cfb\u7edf\u8d44\u6e90\u9650\u5236&#xff1a;<\/p>\n<p>\u5982\u679c\u7cfb\u7edf\u8d44\u6e90\u8fc7\u4e8e\u7d27\u5f20&#xff08;\u5982\u5185\u5b58\u6216\u78c1\u76d8\u7a7a\u95f4&#xff09;&#xff0c;\u4e5f\u53ef\u80fd\u5bfc\u81f4 MySQL \u65e0\u6cd5\u542f\u52a8\u3002\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7cfb\u7edf\u8d44\u6e90\u72b6\u6001&#xff1a;<\/p>\n<p> <span class=\"token function\">free<\/span> -h   <span class=\"token comment\"># \u67e5\u770b\u5185\u5b58<\/span><br \/>\n<span class=\"token function\">df<\/span> -h     <span class=\"token comment\"># \u67e5\u770b\u78c1\u76d8<\/span>\n <\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<h4>4. macOS<\/h4>\n<p>macOS \u4e0a\u7684 MySQL \u4e5f\u53ef\u80fd\u9047\u5230\u7c7b\u4f3c\u7684\u95ee\u9898&#xff0c;\u901a\u5e38\u662f\u7531\u4e8e MySQL \u670d\u52a1\u672a\u542f\u52a8\u6216\u9632\u706b\u5899\u8bbe\u7f6e\u4e0d\u5f53\u3002macOS \u4e0a\u7684 MySQL \u670d\u52a1\u7ba1\u7406\u4e0e Linux \u76f8\u4f3c&#xff0c;\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u6309\u7c7b\u4f3c\u65b9\u5f0f\u8fdb\u884c\u6392\u67e5\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u542f\u52a8 MySQL \u670d\u52a1&#xff1a;<\/p>\n<p>\u5982\u679c MySQL \u670d\u52a1\u6ca1\u6709\u542f\u52a8&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5b83&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> \/usr\/local\/mysql\/support-files\/mysql.server start\n <\/li>\n<li>\n<p>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;<\/p>\n<p>macOS \u4f7f\u7528 pf \u9632\u706b\u5899&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u9632\u706b\u5899\u89c4\u5219&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> pfctl -sr<\/p>\n<p>\u5982\u679c\u9700\u8981&#xff0c;\u53ef\u4ee5\u901a\u8fc7 pfctl \u547d\u4ee4\u624b\u52a8\u5141\u8bb8\u7aef\u53e3 3306 \u7684\u6d41\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5 MySQL \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>\u6253\u5f00 MySQL \u914d\u7f6e\u6587\u4ef6&#xff0c;\u786e\u4fdd bind-address \u8bbe\u7f6e\u4e3a 127.0.0.1&#xff1a;<\/p>\n<p> bind-address &#061; 127.0.0.1\n <\/li>\n<li>\n<p>\u68c0\u67e5\u7cfb\u7edf\u65e5\u5fd7&#xff1a;<\/p>\n<p>\u5982\u679c MySQL \u670d\u52a1\u542f\u52a8\u5931\u8d25&#xff0c;\u67e5\u770b\u7cfb\u7edf\u65e5\u5fd7\u6587\u4ef6 \/var\/log\/system.log \u4ee5\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<h4>5. Ubuntu&#xff08;\u8be6\u7ec6\u7248&#xff09;<\/h4>\n<p>Ubuntu \u548c Linux \u7cfb\u7edf\u7684\u914d\u7f6e\u548c\u6392\u67e5\u6b65\u9aa4\u975e\u5e38\u7c7b\u4f3c&#xff0c;\u4f46 Ubuntu \u63d0\u4f9b\u4e86\u66f4\u4fbf\u6377\u7684\u5305\u7ba1\u7406\u7cfb\u7edf\u548c\u670d\u52a1\u7ba1\u7406\u5de5\u5177&#xff0c;\u5e2e\u52a9\u5f00\u53d1\u8005\u548c\u7ba1\u7406\u5458\u66f4\u8f7b\u677e\u5730\u5904\u7406 MySQL \u670d\u52a1\u7684\u95ee\u9898\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/h5>\n<ul>\n<li>\n<p>\u68c0\u67e5 MySQL \u670d\u52a1&#xff1a;<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5 MySQL \u670d\u52a1\u72b6\u6001&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl status mysql<\/p>\n<p>\u5982\u679c MySQL \u670d\u52a1\u672a\u542f\u52a8&#xff0c;\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl start mysql<\/p>\n<p>\u5982\u679c\u670d\u52a1\u6ca1\u6709\u6b63\u5e38\u542f\u52a8&#xff0c;\u53ef\u4ee5\u67e5\u770b MySQL \u9519\u8bef\u65e5\u5fd7 \/var\/log\/mysql\/error.log \u4ee5\u8fdb\u4e00\u6b65\u8c03\u67e5\u3002<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;Ubuntu \u4f7f\u7528 ufw \u6765\u7ba1\u7406\u9632\u706b\u5899\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4 3306 \u7aef\u53e3\u662f\u5426\u5f00\u653e&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw status<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u5f00\u653e 3306 \u7aef\u53e3&#xff0c;\u53ef\u4ee5\u8fd0\u884c&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw allow <span class=\"token number\">3306<\/span>\n <\/li>\n<li>\n<p>\u67e5\u770b MySQL \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>\u786e\u4fdd bind-address \u8bbe\u7f6e\u4e3a 127.0.0.1&#xff0c;\u800c\u4e0d\u662f 0.0.0.0 \u6216\u5176\u4ed6\u4e0d\u9002\u5408\u672c\u5730\u8fde\u63a5\u7684 IP \u5730\u5740\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>\u89e3\u51b3\u65b9\u6848\u6743\u91cd&#xff1a;&#x1f31f;&#x1f31f;&#x1f31f;&#x1f31f;<\/h5>\n<hr \/>\n<h4>\u603b\u7ed3<\/h4>\n<p>\u901a\u8fc7\u5bf9\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf&#xff08;Windows 10\u3001Windows 11\u3001Linux\u3001macOS \u548c Ubuntu&#xff09;\u7684\u8be6\u7ec6\u5206\u6790&#xff0c;\u6211\u4eec\u4e86\u89e3\u4e86 MySQL \u8fde\u63a5\u95ee\u9898\u53ef\u80fd\u7684\u539f\u56e0\u4ee5\u53ca\u5982\u4f55\u9010\u4e00\u89e3\u51b3\u3002\u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u7684\u914d\u7f6e\u548c\u670d\u52a1\u72b6\u6001\u662f\u89e3\u51b3 MySQL 2003 \u9519\u8bef\u7684\u5173\u952e\u6240\u5728&#xff0c;\u786e\u4fdd\u670d\u52a1\u6b63\u5e38\u542f\u52a8\u3001\u914d\u7f6e\u6587\u4ef6\u6b63\u786e\u3001\u7f51\u7edc\u548c\u9632\u706b\u5899\u8bbe\u7f6e\u5f97\u5f53\u662f\u89e3\u51b3\u95ee\u9898\u7684\u4e3b\u8981\u6b65\u9aa4\u3002\u5e0c\u671b\u8fd9\u90e8\u5206\u5185\u5bb9\u80fd\u5e2e\u52a9\u5927\u5bb6\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e0b\u9ad8\u6548\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101811-680226e319845.webp\" alt=\"\u732b\u5934\u864e\" \/><\/p>\n<h2>\u7c89\u4e1d\u798f\u5229<\/h2>\n<hr \/>\n<p>&#x1f449; <font face=\"\u6977\u4f53\" color=\"red\" size=\"4\">\u66f4\u591a\u4fe1\u606f<\/font>&#xff1a;\u6709\u4efb\u4f55\u7591\u95ee\u6216\u8005\u9700\u8981\u8fdb\u4e00\u6b65\u63a2\u8ba8\u7684\u5185\u5bb9&#xff0c;\u6b22\u8fce\u70b9\u51fb\u6587\u672b\u540d\u7247\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002\u6211\u662f<font face=\"\u4eff\u5b8b\" color=\"red\" size=\"4\">\u732b\u5934\u864e\u535a\u4e3b<\/font>&#xff0c;\u671f\u5f85\u4e0e\u60a8\u7684\u4ea4\u6d41&#xff01; &#x1f989;&#x1f4ac; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101811-680226e31ee17.png\" alt=\"\u732b\u5934\u864e\" \/><\/p>\n<hr \/>\n<h4>\u8054\u7cfb\u6211\u4e0e\u7248\u6743\u58f0\u660e &#x1f4e9;<\/h4>\n<ul>\n<li>\u8054\u7cfb\u65b9\u5f0f&#xff1a;\n<ul>\n<li>\u5fae\u4fe1: <font face=\"courier New\" color=\"#FF4500\" size=\"4\">Libin9iOak<\/font><\/li>\n<li>\u516c\u4f17\u53f7: <font face=\"\u6977\u4f53\" color=\"#32CD32\" size=\"4\">\u732b\u5934\u864e\u6280\u672f\u56e2\u961f<\/font><\/li>\n<\/ul>\n<\/li>\n<li>\u7248\u6743\u58f0\u660e&#xff1a; \u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0&#xff0c;\u7248\u6743\u5f52\u4f5c\u8005\u6240\u6709\u3002\u672a\u7ecf\u8bb8\u53ef&#xff0c;\u7981\u6b62\u8f6c\u8f7d\u3002\u66f4\u591a\u5185\u5bb9\u8bf7\u8bbf\u95ee\u732b\u5934\u864e\u7684\u535a\u5ba2\u9996\u9875\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>\u70b9\u51fb<font face=\"\u6977\u4f53\" color=\"red\" size=\"4\">\u2728\u2b07\ufe0f\u4e0b\u65b9\u540d\u7247\u2b07\ufe0f\u2728<\/font>&#xff0c;\u52a0\u5165<font face=\"\u6977\u4f53\" color=\"blue\" size=\"4\">\u732b\u5934\u864eAI\u5171\u521b\u793e\u7fa4\u77e9\u9635<\/font>\u3002\u4e00\u8d77\u63a2\u7d22\u79d1\u6280\u7684\u672a\u6765&#xff0c;\u5171\u540c\u6210\u957f\u3002&#x1f680;<\/p>\n<p> <font face=\"\u6977\u4f53\" color=\"blue\" size=\"4\">&#x1f517; \u732b\u5934\u864e\u62b1\u56e2AI\u5171\u521b\u793e\u7fa4<\/font> |<br \/>\n <font face=\"\u6977\u4f53\" color=\"green\" size=\"4\">&#x1f517; Go\u8bed\u8a00VIP\u4e13\u680f<\/font> |<br \/>\n <font face=\"\u6977\u4f53\" color=\"purple\" size=\"4\">&#x1f517; GitHub \u4ee3\u7801\u4ed3\u5e93<\/font> |<br \/>\n <font face=\"\u6977\u4f53\" color=\"red\" size=\"4\">&#x1f517; Go\u751f\u6001\u6d1e\u5bdf\u4e13\u680f<\/font> <\/p>\n<p> <font face=\"\u6977\u4f53\" color=\"#FF4500\" size=\"4\">\u2728 \u732b\u5934\u864e\u7cbe\u54c1\u535a\u6587<\/font> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.7k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf28\u6b21\u3002\u8fde\u63a5\u672c\u5730 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u5728\u65e5\u5e38\u7684 MySQL \u5f00\u53d1\u6216\u8fd0\u7ef4\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\u51fa\u73b0 2003 &#8211; Can\\&#8217;t connect to MySQL server on \\&#8217;localhost\\&#8217; (10061) \u9519\u8bef\u3002\u8fd9\u7c7b\u95ee\u9898\u4e0d\u4ec5\u4ec5\u51fa\u73b0\u5728\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u6216 MySQL \u7248\u672c\u4e0b\uff0c\u4e5f\u53ef\u80fd\u7531\u591a\u79cd\u56e0\u7d20\u5bfc\u81f4\u3002\u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u6216\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u5c06\u4ece\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af_2003cant connect mysql server on 10061<\/p>\n","protected":false},"author":2,"featured_media":10880,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,330,114,100,43,44,250],"topic":[],"class_list":["post-10884","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-centos","tag-macos","tag-mysql","tag-100","tag-43","tag-44","tag-250"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/10884.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.7k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf28\u6b21\u3002\u8fde\u63a5\u672c\u5730 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u5728\u65e5\u5e38\u7684 MySQL \u5f00\u53d1\u6216\u8fd0\u7ef4\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\u51fa\u73b0 2003 - Can&#039;t connect to MySQL server on &#039;localhost&#039; (10061) \u9519\u8bef\u3002\u8fd9\u7c7b\u95ee\u9898\u4e0d\u4ec5\u4ec5\u51fa\u73b0\u5728\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u6216 MySQL \u7248\u672c\u4e0b\uff0c\u4e5f\u53ef\u80fd\u7531\u591a\u79cd\u56e0\u7d20\u5bfc\u81f4\u3002\u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u6216\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u5c06\u4ece\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af_2003cant connect mysql server on 10061\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/10884.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:18:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101809-680226e15d03e.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10884.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/10884.html\",\"name\":\"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:18:13+00:00\",\"dateModified\":\"2025-04-18T10:18:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/10884.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/10884.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10884.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/10884.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb6.7k\u6b21\uff0c\u70b9\u8d5e28\u6b21\uff0c\u6536\u85cf28\u6b21\u3002\u8fde\u63a5\u672c\u5730 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u5728\u65e5\u5e38\u7684 MySQL \u5f00\u53d1\u6216\u8fd0\u7ef4\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u8fde\u63a5 MySQL \u6570\u636e\u5e93\u65f6\u51fa\u73b0 2003 - Can't connect to MySQL server on 'localhost' (10061) \u9519\u8bef\u3002\u8fd9\u7c7b\u95ee\u9898\u4e0d\u4ec5\u4ec5\u51fa\u73b0\u5728\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u6216 MySQL \u7248\u672c\u4e0b\uff0c\u4e5f\u53ef\u80fd\u7531\u591a\u79cd\u56e0\u7d20\u5bfc\u81f4\u3002\u4e3a\u4e86\u5e2e\u52a9\u5f00\u53d1\u8005\u6216\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u4eec\u5c06\u4ece\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u73af_2003cant connect mysql server on 10061","og_url":"https:\/\/www.wsisp.com\/helps\/10884.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:18:13+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101809-680226e15d03e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/10884.html","url":"https:\/\/www.wsisp.com\/helps\/10884.html","name":"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:18:13+00:00","dateModified":"2025-04-18T10:18:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/10884.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/10884.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/10884.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8fde\u63a5\u672c\u5730\u548c\u670d\u52a1\u5668 MySQL \u65f6\u51fa\u73b0 2003-Can\u2019t connect to MySQL server on \u2018localhost\u2019(10061) \u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=10884"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10884\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/10880"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=10884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=10884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=10884"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=10884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}