{"id":196,"date":"2026-07-16T17:22:24","date_gmt":"2026-07-16T09:22:24","guid":{"rendered":"https:\/\/pc.wuhanioe.com\/index.php\/2026\/07\/16\/mysql-%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5%e5%88%ab%e6%85%8c%e5%bc%a0%ef%bc%9a%e7%ab%af%e5%8f%a3%e8%a2%ab%e5%8d%a0%e7%94%a8%e4%b8%8e%e9%85%8d%e7%bd%ae%e9%94%99%e8%af%af%e7%9a%84%e7%b3%bb%e7%bb%9f\/"},"modified":"2026-07-16T17:22:24","modified_gmt":"2026-07-16T09:22:24","slug":"mysql-%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5%e5%88%ab%e6%85%8c%e5%bc%a0%ef%bc%9a%e7%ab%af%e5%8f%a3%e8%a2%ab%e5%8d%a0%e7%94%a8%e4%b8%8e%e9%85%8d%e7%bd%ae%e9%94%99%e8%af%af%e7%9a%84%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/pc.wuhanioe.com\/index.php\/2026\/07\/16\/mysql-%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5%e5%88%ab%e6%85%8c%e5%bc%a0%ef%bc%9a%e7%ab%af%e5%8f%a3%e8%a2%ab%e5%8d%a0%e7%94%a8%e4%b8%8e%e9%85%8d%e7%bd%ae%e9%94%99%e8%af%af%e7%9a%84%e7%b3%bb%e7%bb%9f\/","title":{"rendered":"MySQL \u542f\u52a8\u5931\u8d25\u522b\u614c\u5f20\uff1a\u7aef\u53e3\u88ab\u5360\u7528\u4e0e\u914d\u7f6e\u9519\u8bef\u7684\u7cfb\u7edf\u6392\u67e5\u6cd5"},"content":{"rendered":"<p>\u5f88\u591a\u5f00\u53d1\u8005\u5728\u672c\u5730\u642d MySQL \u65f6\u90fd\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f\uff1a\u670d\u52a1\u4e00\u542f\u52a8\u5c31\u79d2\u9000\uff0c\u547d\u4ee4\u884c\u53ea\u56de\u4e00\u53e5\u300e\u670d\u52a1\u6ca1\u6709\u53ca\u65f6\u54cd\u5e94\u300f\u3002\u5176\u5b9e MySQL \u542f\u52a8\u5931\u8d25\u5927\u591a\u9003\u4e0d\u51fa\u56db\u7c7b\u539f\u56e0\u2014\u2014\u7aef\u53e3\u88ab\u5360\u7528\u3001\u914d\u7f6e\u6587\u4ef6\u5199\u9519\u3001\u6570\u636e\u76ee\u5f55\u6743\u9650\u5f02\u5e38\u3001\u6216\u524d\u6b21\u5f02\u5e38\u9000\u51fa\u7559\u4e0b\u7684\u9501\u6587\u4ef6\u3002\u672c\u6587\u7528\u4e00\u6761\u53ef\u590d\u73b0\u7684\u6392\u67e5\u94fe\u8def\uff0c\u5e26\u4f60\u4ece\u65e5\u5fd7\u5165\u624b\uff0c\u9010\u4e00\u5b9a\u4f4d\u5e76\u89e3\u51b3\u3002<\/p>\n<h2>\u4e00\u3001\u5148\u8bfb\u9519\u8bef\u65e5\u5fd7\uff0c\u522b\u6025\u7740\u53cd\u590d\u91cd\u542f<\/h2>\n<p>\u53cd\u590d\u70b9\u51fb\u300e\u542f\u52a8\u300f\u5f80\u5f80\u53ea\u4f1a\u63a9\u76d6\u771f\u76f8\u3002<strong>\u9519\u8bef\u65e5\u5fd7\u624d\u662f\u7b2c\u4e00\u73b0\u573a<\/strong>\u3002\u65e5\u5fd7\u4f4d\u7f6e\u901a\u5e38\u5728\u6570\u636e\u76ee\u5f55\u4e0b\uff0c\u6587\u4ef6\u540d\u5f62\u5982 <code>hostname.err<\/code>\uff0cWindows \u5b89\u88c5\u7248\u4e5f\u53ef\u80fd\u5199\u5230 <code>%PROGRAMDATA%\\MySQL\\MySQL Server 8.0\\Data<\/code>\u3002\u6253\u5f00\u5b83\uff0c\u91cd\u70b9\u627e <code>[ERROR]<\/code> \u5f00\u5934\u7684\u4e00\u884c\uff0c\u6bd4\u5982 <code>Can't start server: Bind on TCP\/IP port: 3306<\/code> \u6216 <code>Do you already have another mysqld server running<\/code>\uff0c\u8fd9\u51e0\u4e4e\u76f4\u63a5\u544a\u8bc9\u4f60\u75c5\u6839\u3002<\/p>\n<h2>\u4e8c\u3001\u5b9a\u4f4d\u5e76\u91ca\u653e\u88ab\u5360\u7528\u7684 3306 \u7aef\u53e3<\/h2>\n<p>\u5982\u679c\u65e5\u5fd7\u6307\u5411\u7aef\u53e3\uff0c\u6309\u7cfb\u7edf\u6267\u884c\uff1a<\/p>\n<ol>\n<li>Windows\uff1a\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u6267\u884c <code>netstat -ano | findstr :3306<\/code>\uff0c\u8bb0\u4e0b\u6700\u540e\u4e00\u5217\u7684 PID\u3002<\/li>\n<li>\u6839\u636e PID \u67e5\u8fdb\u7a0b\u540d\uff1a<code>tasklist \/FI \"PID eq 1234\"<\/code>\uff08\u82e5\u786e\u4e3a\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\uff0c\u53ef\u9009 <code>taskkill \/PID 1234 \/F<\/code> \u7ed3\u675f\u5b83\uff09\u3002<\/li>\n<li>Linux\/macOS\uff1a\u6267\u884c <code>lsof -i:3306<\/code> \u6216 <code>ss -tlnp | grep 3306<\/code>\uff0c\u518d\u7528 <code>kill -9 PID<\/code> \u91ca\u653e\u3002<\/li>\n<li>\u82e5\u5360\u7528\u8005\u4e5f\u662f\u53e6\u4e00\u4e2a MySQL \u5b9e\u4f8b\uff0c\u5efa\u8bae\u6539\u7aef\u53e3\u800c\u975e\u5f3a\u6740\uff1a\u5728\u914d\u7f6e\u91cc\u52a0 <code>port=3307<\/code> \u5e76\u91cd\u542f\u3002<\/li>\n<\/ol>\n<h2>\u4e09\u3001\u68c0\u67e5 my.ini \/ my.cnf \u914d\u7f6e\u9677\u9631<\/h2>\n<p>\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u5199\u9519\u4f1a\u8ba9 MySQL \u8bfb\u4e0d\u5230\u8bbe\u7f6e\u3002<strong>basedir \u4e0e datadir \u5fc5\u987b\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u4e14\u5206\u9694\u7b26\u6b63\u786e<\/strong>\u3002Windows \u4e0b\u63a8\u8350\u7528\u6b63\u659c\u6760\u6216\u53cc\u53cd\u659c\u6760\uff0c\u4f8b\u5982 <code>basedir=D:\/mysql-8.0<\/code>\u3002\u5e38\u89c1\u5751\u8fd8\u6709\uff1a\u5728 <code>[mysqld]<\/code> \u6bb5\u4e4b\u5916\u5199\u4e86 <code>default-character-set<\/code>\uff08\u5e94\u653e\u5728 <code>[client]<\/code> \u6216 <code>[mysql]<\/code> \u6bb5\uff09\uff0c\u4ee5\u53ca <code>innodb_buffer_pool_size<\/code> \u8bbe\u5f97\u8d85\u8fc7\u7269\u7406\u5185\u5b58\u5bfc\u81f4\u7533\u8bf7\u5931\u8d25\u3002<\/p>\n<h2>\u56db\u3001\u6570\u636e\u76ee\u5f55\u6743\u9650\u4e0e\u6b8b\u7559\u9501\u6587\u4ef6<\/h2>\n<ol>\n<li>\u786e\u8ba4 datadir \u76ee\u5f55\u5b58\u5728\u4e14\u5f53\u524d\u8fd0\u884c\u8d26\u6237\u6709\u5b8c\u5168\u63a7\u5236\u6743\uff0cWindows \u670d\u52a1\u8d26\u6237\u5e38\u4e3a <code>NETWORK SERVICE<\/code> \u6216 <code>Local System<\/code>\u3002<\/li>\n<li>\u82e5\u4e0a\u6b21\u662f\u5f3a\u5236\u65ad\u7535\u9000\u51fa\uff0cdatadir \u4e0b\u53ef\u80fd\u6b8b\u7559 <code>ib_logfile*<\/code> \u6216 <code>*.pid<\/code> \u9501\u6587\u4ef6\uff0c\u5220\u9664\u5bf9\u5e94 pid \u6587\u4ef6\u540e\u91cd\u8bd5\u3002<\/li>\n<li>\u6700\u7a33\u59a5\u7684\u9a8c\u8bc1\uff1a\u7528\u624b\u52a8\u524d\u53f0\u65b9\u5f0f\u542f\u52a8 <code>mysqld --console<\/code>\uff0c\u9519\u8bef\u4fe1\u606f\u4f1a\u76f4\u63a5\u6253\u5370\u5230\u5c4f\u5e55\uff0c\u4fbf\u4e8e\u5224\u65ad\u3002<\/li>\n<\/ol>\n<p><strong>\u6280\u672f\u5c0f\u7ed3\uff1a<\/strong>MySQL \u542f\u52a8\u5931\u8d25\u6392\u67e5\u7684\u9ec4\u91d1\u987a\u5e8f\u662f\u300e\u770b\u65e5\u5fd7 \u2192 \u67e5\u7aef\u53e3 \u2192 \u6821\u914d\u7f6e \u2192 \u6e05\u9501\u6587\u4ef6\u300f\u3002\u7edd\u5927\u591a\u6570\u95ee\u9898\u90fd\u80fd\u5728\u8fd9\u56db\u6b65\u5185\u5b9a\u4f4d\uff0c\u5207\u52ff\u9760\u53cd\u590d\u91cd\u542f\u78b0\u8fd0\u6c14\uff0c\u90a3\u6837\u53ea\u4f1a\u8ba9\u65e5\u5fd7\u88ab\u8986\u76d6\u3001\u73b0\u573a\u6d88\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece\u9519\u8bef\u65e5\u5fd7\u3001\u7aef\u53e3\u5360\u7528\u5230\u914d\u7f6e\u6587\u4ef6\u9010\u9879\u6392\u67e5\uff0c\u4e09\u6b65\u8ba9 MySQL \u91cd\u65b0\u8dd1\u8d77\u6765\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts\/196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/comments?post=196"}],"version-history":[{"count":0,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"wp:attachment":[{"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pc.wuhanioe.com\/index.php\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}