{"id":5520,"date":"2024-11-14T11:38:36","date_gmt":"2024-11-14T03:38:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5520\/"},"modified":"2024-11-14T11:38:36","modified_gmt":"2024-11-14T03:38:36","slug":"mysql%e7%ab%af%e5%8f%a3%e5%8f%b7%e6%80%8e%e4%b9%88%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5520\/","title":{"rendered":"mysql\u7aef\u53e3\u53f7\u600e\u4e48\u4fee\u6539"},"content":{"rendered":"<blockquote><p>\n  mysql\u7aef\u53e3\u53f7\u4fee\u6539\u65b9\u6cd5\uff1a1. \u4fee\u6539my.cnf\u6587\u4ef6\u4e2d\u7684port\u503c\uff1b2. \u91cd\u542fmysql\u670d\u52a1\uff1b3. \u4f7f\u7528netstat -ano | grep mysql\u9a8c\u8bc1\u7aef\u53e3\u53f7\u5df2\u4fee\u6539\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/29\/2024052907362354851.jpg\" class=\"aligncenter\" title=\"mysql\u7aef\u53e3\u53f7\u600e\u4e48\u4fee\u6539\u63d2\u56fe\" alt=\"mysql\u7aef\u53e3\u53f7\u600e\u4e48\u4fee\u6539\u63d2\u56fe\" \/><\/p>\n<h2>MySQL \u7aef\u53e3\u53f7\u4fee\u6539\u65b9\u6cd5<\/h2>\n<p>MySQL \u9ed8\u8ba4\u4f7f\u7528 3306 \u7aef\u53e3\uff0c\u4f46\u51fa\u4e8e\u5b89\u5168\u6216\u5176\u4ed6\u539f\u56e0\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4fee\u6539\u7aef\u53e3\u53f7\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u64cd\u4f5c\uff1a<\/p>\n<h3>\u6b65\u9aa4 1\uff1a\u4fee\u6539 my.cnf \u6587\u4ef6<\/h3>\n<ul>\n<li>\n<p>\u627e\u5230 MySQL \u914d\u7f6e\u6587\u4ef6\uff08my.cnf\uff09\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u4f4d\u7f6e\uff1a<\/p>\n<ul>\n<li> <strong>Linux\/macOS\uff1a<\/strong> \/etc\/\/my.cnf<\/li>\n<li> <strong>Windows\uff1a<\/strong> C:ProgramDataMySQLMySQL Server [version number]my.ini<\/li>\n<\/ul>\n<\/li>\n<li>\u6253\u5f00 my.cnf \u6587\u4ef6\u5e76\u7f16\u8f91\u4ee5\u4e0b\u884c\uff08\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5219\u6dfb\u52a0\uff09\uff1a<\/li>\n<\/ul>\n<pre>port = [\u65b0\u7aef\u53e3\u53f7]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h3>\u6b65\u9aa4 2\uff1a\u91cd\u542f MySQL \u670d\u52a1<\/h3>\n<ul>\n<li>\n<p>\u505c\u6b62 MySQL \u670d\u52a1\uff1a<\/p>\n<ul>\n<li> <strong>Linux\/macOS\uff1a<\/strong> sudo service mysql stop<\/li>\n<li> <strong>Windows\uff1a<\/strong> net stop mysql<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u542f\u52a8 MySQL \u670d\u52a1\uff1a<\/p>\n<ul>\n<li> <strong>Linux\/macOS\uff1a<\/strong> sudo service mysql start<\/li>\n<li> <strong>Windows\uff1a<\/strong> net start mysql<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6b65\u9aa4 3\uff1a\u9a8c\u8bc1\u7aef\u53e3\u53f7<\/h3>\n<ul>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u7aef\u53e3\u53f7\u662f\u5426\u5df2\u4fee\u6539\uff1a<\/li>\n<\/ul>\n<pre>netstat -ano | grep mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u8f93\u51fa\u4e2d\u5e94\u663e\u793a\u5df2\u4fee\u6539\u7684\u7aef\u53e3\u53f7\u3002<\/li>\n<\/ul>\n<h3>\u9644\u52a0\u6b65\u9aa4\uff08\u53ef\u9009\uff09<\/h3>\n<ul>\n<li> <strong>\u9632\u706b\u5899\u89c4\u5219\uff1a<\/strong>\u5982\u679c\u60a8\u7684\u7cfb\u7edf\u542f\u7528\u4e86\u9632\u706b\u5899\uff0c\u8bf7\u786e\u4fdd\u5141\u8bb8\u8bbf\u95ee\u65b0\u7684\u7aef\u53e3\u53f7\u3002<\/li>\n<li> <strong>\u5e94\u7528\u7a0b\u5e8f\u914d\u7f6e\uff1a<\/strong>\u66f4\u65b0\u4f7f\u7528 MySQL \u7684\u4efb\u4f55\u5e94\u7528\u7a0b\u5e8f\u7684\u8fde\u63a5\u8bbe\u7f6e\uff0c\u4ee5\u4f7f\u7528\u65b0\u7684\u7aef\u53e3\u53f7\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7aef\u53e3\u53f7\u600e\u4e48\u4fee\u6539\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mysql\u7aef\u53e3\u53f7\u4fee\u6539\u65b9\u6cd5\uff1a1. \u4fee\u6539my.cnf\u6587\u4ef6\u4e2d\u7684port\u503c\uff1b2. \u91cd\u542fmysql\u670d\u52a1\uff1b3. \u4f7f\u7528netstat -ano | grep mysql\u9a8c\u8bc1\u7aef\u53e3\u53f7\u5df2\u4fee\u6539\u3002 MySQL \u7aef\u53e3\u53f7\u4fee\u6539\u65b9\u6cd5 MySQL \u9ed8\u8ba4\u4f7f\u7528 3306 \u7aef\u53e3\uff0c\u4f46\u51fa\u4e8e\u5b89\u5168\u6216\u5176\u4ed6\u539f\u56e0\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u4fee\u6539\u7aef\u53e3\u53f7\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u64cd\u4f5c\uff1a \u6b65\u9aa4 1\uff1a\u4fee\u6539 my.cnf \u6587\u4ef6 \u627e\u5230 MySQL \u914d\u7f6e\u6587\u4ef6\uff08my.cnf\uff09\uff0c\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u4f4d\u7f6e\uff1a Linux\/macOS\uff1a \/etc\/\/my.cnf Windows\uff1a C:ProgramDataMySQLMySQL Server [version number]my.ini \u6253\u5f00 my.cnf \u6587\u4ef6\u5e76\u7f16\u8f91\u4ee5\u4e0b\u884c\uff08\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5219\u6dfb\u52a0\uff09\uff1a port = [\u65b0\u7aef\u53e3\u53f7] \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u91cd\u542f MySQL \u670d\u52a1 \u505c\u6b62 MySQL \u670d\u52a1\uff1a Linux\/macOS\uff1a sudo service mysql stop Windows\uff1a net stop mysql \u542f\u52a8 MySQL \u670d\u52a1\uff1a Linux\/macOS\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5520","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5520"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5520\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}