{"id":5426,"date":"2024-11-14T09:14:25","date_gmt":"2024-11-14T01:14:25","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5426\/"},"modified":"2024-11-14T09:14:25","modified_gmt":"2024-11-14T01:14:25","slug":"%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8bmysql%e7%ab%af%e5%8f%a3%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5426\/","title":{"rendered":"\u600e\u4e48\u67e5\u770bmysql\u7aef\u53e3\u53f7"},"content":{"rendered":"<blockquote><p>\n  mysql\u7aef\u53e3\u53f7\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u67e5\u770b\uff1a1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff1b2. \u4f7f\u7528\u547d\u4ee4\u884c netstat -anp | grep mysql\uff1b3. \u4f7f\u7528 mysql \u547d\u4ee4 show variables like &#8220;%port%&#8221;; 4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff08\u4f8b\u5982 mysql workbench \u6216 phpmyadmin\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/28\/2024052812272319601.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u67e5\u770bmysql\u7aef\u53e3\u53f7\u63d2\u56fe\" alt=\"\u600e\u4e48\u67e5\u770bmysql\u7aef\u53e3\u53f7\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b MySQL \u7aef\u53e3\u53f7<\/strong><\/p>\n<p>\u67e5\u770b MySQL \u7aef\u53e3\u53f7\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u4f7f\u7528\u7684\u5e73\u53f0\u548c MySQL \u7248\u672c\u3002\u4ee5\u4e0b\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<p>MySQL \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u79f0\u4e3a my.cnf \u6216 my.ini\u3002\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff0c\u67e5\u627e port \u8bbe\u7f6e\u3002\u901a\u5e38\uff0c\u9ed8\u8ba4\u7aef\u53e3\u4e3a 3306\u3002<\/p>\n<p><strong>2. \u4f7f\u7528\u547d\u4ee4\u884c<\/strong><\/p>\n<p>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>netstat -anp | grep mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u663e\u793a\u6240\u6709\u6b63\u5728\u4fa6\u542c\u7684\u7f51\u7edc\u8fde\u63a5\uff0c\u5176\u4e2d\u5305\u62ec MySQL \u8fde\u63a5\u3002\u627e\u5230\u8fde\u63a5\u72b6\u6001\u4e3a LISTEN\uff0c\u4e14\u7aef\u53e3\u53f7\u4e3a MySQL \u7aef\u53e3\u53f7\u7684\u90a3\u4e00\u884c\u3002<\/p>\n<p><strong>3. \u4f7f\u7528 MySQL \u547d\u4ee4<\/strong><\/p>\n<p>\u542f\u52a8 MySQL \u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>SHOW VARIABLES LIKE \"%port%\";<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u663e\u793a\u6240\u6709\u4e0e\u7aef\u53e3\u76f8\u5173\u7684\u53d8\u91cf\uff0c\u5305\u62ec port\u3002<\/p>\n<p><strong>4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177<\/strong><\/p>\n<p>\u6709\u8bb8\u591a\u7b2c\u4e09\u65b9\u5de5\u5177\u53ef\u4ee5\u7528\u6765\u83b7\u53d6 MySQL \u7aef\u53e3\u53f7\uff0c\u4f8b\u5982 MySQL Workbench \u6216 phpMyAdmin\u3002\u8fd9\u4e9b\u5de5\u5177\u63d0\u4f9b\u4e86\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u8bbf\u95ee MySQL \u670d\u52a1\u5668\u914d\u7f6e\u3002<\/p>\n<p><strong>\u5176\u4ed6\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u6b63\u5728\u4f7f\u7528\u4e91\u6258\u7ba1\u7684 MySQL \u670d\u52a1\uff0c\u7aef\u53e3\u53f7\u53ef\u80fd\u4e0e\u60a8\u672c\u5730\u5b89\u88c5\u7684\u4e0d\u540c\u3002\u8bf7\u54a8\u8be2\u60a8\u7684\u4e91\u63d0\u4f9b\u5546\u4ee5\u83b7\u53d6\u786e\u5207\u7684\u7aef\u53e3\u53f7\u3002<\/li>\n<li>\u4e00\u4e9b MySQL \u5b9e\u4f8b\u53ef\u80fd\u4f1a\u914d\u7f6e\u4e3a\u4fa6\u542c\u591a\u4e2a\u7aef\u53e3\u3002\u4f7f\u7528\u4e0a\u8ff0\u65b9\u6cd5\u68c0\u67e5\u6240\u6709\u53ef\u80fd\u7684\u7aef\u53e3\u3002<\/li>\n<li>\u5982\u679c\u60a8\u65e0\u6cd5\u627e\u5230 MySQL \u7aef\u53e3\u53f7\uff0c\u8bf7\u786e\u4fdd MySQL \u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770b\u7aef\u53e3\u53f7\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\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u67e5\u770b\uff1a1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\uff1b2. \u4f7f\u7528\u547d\u4ee4\u884c netstat -anp | grep mysql\uff1b3. \u4f7f\u7528 mysql \u547d\u4ee4 show variables like &#8220;%port%&#8221;; 4. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff08\u4f8b\u5982 mysql workbench \u6216 phpmyadmin\uff09\u3002 \u5982\u4f55\u67e5\u770b MySQL \u7aef\u53e3\u53f7 \u67e5\u770b MySQL \u7aef\u53e3\u53f7\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u4f7f\u7528\u7684\u5e73\u53f0\u548c MySQL \u7248\u672c\u3002\u4ee5\u4e0b\u662f\u6700\u5e38\u7528\u7684\u65b9\u6cd5\uff1a 1. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6 MySQL \u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u79f0\u4e3a my.cnf \u6216 my.ini\u3002\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff0c\u67e5\u627e port \u8bbe\u7f6e\u3002\u901a\u5e38\uff0c\u9ed8\u8ba4\u7aef\u53e3\u4e3a 3306\u3002 2. \u4f7f\u7528\u547d\u4ee4\u884c \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a netstat -anp | grep mysql \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u663e\u793a\u6240\u6709\u6b63\u5728\u4fa6\u542c\u7684\u7f51\u7edc\u8fde\u63a5\uff0c\u5176\u4e2d\u5305\u62ec MySQL \u8fde\u63a5\u3002\u627e\u5230\u8fde\u63a5\u72b6\u6001\u4e3a LISTEN\uff0c\u4e14\u7aef\u53e3\u53f7\u4e3a MySQL \u7aef\u53e3\u53f7\u7684\u90a3\u4e00\u884c\u3002 3. [&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-5426","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5426","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=5426"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5426\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}