{"id":17826,"date":"2024-11-18T10:03:13","date_gmt":"2024-11-18T02:03:13","guid":{"rendered":"https:\/\/fwq.ai\/blog\/17826\/"},"modified":"2024-11-18T10:03:13","modified_gmt":"2024-11-18T02:03:13","slug":"phpstudy%e6%95%b0%e6%8d%ae%e5%ba%93%e5%90%af%e5%8a%a8%e4%b8%8d%e4%ba%86%e6%80%8e%e4%b9%88%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/17826\/","title":{"rendered":"phpstudy\u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\u600e\u4e48\u89e3\u51b3"},"content":{"rendered":"<blockquote><p>\n  phpstudy \u6570\u636e\u5e93\u542f\u52a8\u5931\u8d25\u7684\u539f\u56e0\u53ca\u89e3\u51b3\u529e\u6cd5\uff1a\u68c0\u67e5 mysql \u670d\u52a1\u662f\u5426\u5f00\u542f\uff1b\u786e\u8ba4 mysql \u7aef\u53e3\u53f7\u672a\u88ab\u5360\u7528\uff1b\u786e\u4fdd mysql \u7528\u6237\u5177\u6709\u542f\u52a8\u548c\u505c\u6b62\u6570\u636e\u5e93\u7684\u6743\u9650\uff1b\u5141\u8bb8\u9632\u706b\u5899\u901a\u8fc7 mysql \u7aef\u53e3\uff1b\u5c1d\u8bd5\u4fee\u590d\u6216\u91cd\u65b0\u521b\u5efa\u6570\u636e\u5e93\uff1b\u68c0\u67e5 mysql \u670d\u52a1\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff1b\u6392\u67e5\u5176\u4ed6\u8f6f\u4ef6\u51b2\u7a81\uff0c\u5982\u5176\u4ed6\u6570\u636e\u5e93\u8f6f\u4ef6\u6216\u9632\u75c5\u6bd2\u8f6f\u4ef6\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/02\/2024040213451964099.jpg\" class=\"aligncenter\" title=\"phpstudy\u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\u600e\u4e48\u89e3\u51b3\u63d2\u56fe\" alt=\"phpstudy\u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\u600e\u4e48\u89e3\u51b3\u63d2\u56fe\" \/><\/p>\n<p><strong>PHPStudy \u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\uff0c\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p>PHPStudy \u6570\u636e\u5e93\u542f\u52a8\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u4ee5\u4e0b\u539f\u56e0\u5bfc\u81f4\u7684\uff1a<\/p>\n<p><strong>1. \u6570\u636e\u5e93\u670d\u52a1\u672a\u5f00\u542f<\/strong><\/p>\n<ul>\n<li>\u6253\u5f00 PHPStudy \u63a7\u5236\u9762\u677f\u3002<\/li>\n<li>\u70b9\u51fb &#8220;\u6570\u636e\u5e93&#8221; \u9009\u9879\u5361\uff0c\u786e\u4fdd &#8220;MySQL&#8221; \u670d\u52a1\u5df2\u5f00\u542f\u3002<\/li>\n<\/ul>\n<p><strong>2. \u7aef\u53e3\u53f7\u51b2\u7a81<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\u68c0\u67e5 MySQL \u7684\u7aef\u53e3\u53f7\u662f\u5426\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u3002<\/li>\n<li>\n<p>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7aef\u53e3\u53f7\uff1a<\/p>\n<ul>\n<li>Windows\uff1anetstat -ano | findstr &#8220;3306&#8221;<\/li>\n<li>macOS\/Linux\uff1asudo lsof -i | grep mysqld<\/li>\n<\/ul>\n<\/li>\n<li>\u5982\u679c\u7aef\u53e3\u53f7\u88ab\u5360\u7528\uff0c\u8bf7\u66f4\u6539 MySQL \u7aef\u53e3\u53f7\u3002<\/li>\n<\/ul>\n<p><strong>3. \u6743\u9650\u95ee\u9898<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd MySQL \u7528\u6237\u5177\u6709\u542f\u52a8\u548c\u505c\u6b62\u6570\u636e\u5e93\u7684\u6743\u9650\u3002<\/li>\n<li>\u6253\u5f00 PHPStudy \u63a7\u5236\u9762\u677f\uff0c\u70b9\u51fb &#8220;\u6570\u636e\u5e93&#8221; \u9009\u9879\u5361\uff0c\u7136\u540e\u70b9\u51fb &#8220;\u7ba1\u7406&#8221; \u6309\u94ae\u3002<\/li>\n<li>\u5728 &#8220;\u6743\u9650&#8221; \u9009\u9879\u5361\u4e2d\uff0c\u786e\u4fdd\u9009\u4e2d &#8220;GRANT&#8221; \u9009\u9879\u3002<\/li>\n<\/ul>\n<p><strong>4. \u9632\u706b\u5899\u9650\u5236<\/strong><\/p>\n<ul>\n<li>\u68c0\u67e5\u9632\u706b\u5899\u662f\u5426\u963b\u6b62\u4e86\u5bf9 MySQL \u7aef\u53e3\uff08\u9ed8\u8ba4 3306\uff09\u7684\u8bbf\u95ee\u3002<\/li>\n<li>\u6253\u5f00\u9632\u706b\u5899\u8bbe\u7f6e\uff0c\u5e76\u5141\u8bb8 MySQL \u7aef\u53e3\u901a\u8fc7\u3002<\/li>\n<\/ul>\n<p><strong>5. \u6570\u636e\u5e93\u635f\u574f<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u5176\u4ed6\u65b9\u6cd5\u5747\u4e0d\u8d77\u4f5c\u7528\uff0c\u5219\u6570\u636e\u5e93\u53ef\u80fd\u5df2\u635f\u574f\u3002<\/li>\n<li>\u5c1d\u8bd5\u4fee\u590d\u6570\u636e\u5e93\u6216\u91cd\u65b0\u521b\u5efa\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>6. \u670d\u52a1\u914d\u7f6e\u9519\u8bef<\/strong><\/p>\n<ul>\n<li>\u68c0\u67e5 MySQL \u670d\u52a1\u7684\u914d\u7f6e\u662f\u5426\u6b63\u786e\u3002<\/li>\n<li>\u6253\u5f00 PHPStudy \u63a7\u5236\u9762\u677f\uff0c\u70b9\u51fb &#8220;\u6570\u636e\u5e93&#8221; \u9009\u9879\u5361\uff0c\u7136\u540e\u70b9\u51fb &#8220;\u914d\u7f6e&#8221; \u6309\u94ae\u3002<\/li>\n<li>\u786e\u4fdd &#8220;datadir&#8221; \u8def\u5f84\u6b63\u786e\uff0c\u5e76\u4e14 MySQL \u670d\u52a1\u6b63\u5e38\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<p><strong>7. \u8f6f\u4ef6\u51b2\u7a81<\/strong><\/p>\n<ul>\n<li>\u68c0\u67e5\u662f\u5426\u5b58\u5728\u5176\u4ed6\u8f6f\u4ef6\u53ef\u80fd\u4f1a\u4e0e MySQL \u51b2\u7a81\u3002<\/li>\n<li>\u4f8b\u5982\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u8f6f\u4ef6\u6216\u9632\u75c5\u6bd2\u8f6f\u4ef6\u3002<\/li>\n<li>\u5c1d\u8bd5\u6682\u65f6\u7981\u7528\u8fd9\u4e9b\u8f6f\u4ef6\uff0c\u770b\u662f\u5426\u80fd\u89e3\u51b3\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4ee5\u4e0a\u65b9\u6cd5\u5747\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u8bf7\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5 PHPStudy \u6216\u8054\u7cfb MySQL \u5b98\u65b9\u652f\u6301\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fphpstudy\u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\u600e\u4e48\u89e3\u51b3\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>phpstudy \u6570\u636e\u5e93\u542f\u52a8\u5931\u8d25\u7684\u539f\u56e0\u53ca\u89e3\u51b3\u529e\u6cd5\uff1a\u68c0\u67e5 mysql \u670d\u52a1\u662f\u5426\u5f00\u542f\uff1b\u786e\u8ba4 mysql \u7aef\u53e3\u53f7\u672a\u88ab\u5360\u7528\uff1b\u786e\u4fdd mysql \u7528\u6237\u5177\u6709\u542f\u52a8\u548c\u505c\u6b62\u6570\u636e\u5e93\u7684\u6743\u9650\uff1b\u5141\u8bb8\u9632\u706b\u5899\u901a\u8fc7 mysql \u7aef\u53e3\uff1b\u5c1d\u8bd5\u4fee\u590d\u6216\u91cd\u65b0\u521b\u5efa\u6570\u636e\u5e93\uff1b\u68c0\u67e5 mysql \u670d\u52a1\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff1b\u6392\u67e5\u5176\u4ed6\u8f6f\u4ef6\u51b2\u7a81\uff0c\u5982\u5176\u4ed6\u6570\u636e\u5e93\u8f6f\u4ef6\u6216\u9632\u75c5\u6bd2\u8f6f\u4ef6\u3002 PHPStudy \u6570\u636e\u5e93\u542f\u52a8\u4e0d\u4e86\uff0c\u600e\u4e48\u529e\uff1f PHPStudy \u6570\u636e\u5e93\u542f\u52a8\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u4ee5\u4e0b\u539f\u56e0\u5bfc\u81f4\u7684\uff1a 1. \u6570\u636e\u5e93\u670d\u52a1\u672a\u5f00\u542f \u6253\u5f00 PHPStudy \u63a7\u5236\u9762\u677f\u3002 \u70b9\u51fb &#8220;\u6570\u636e\u5e93&#8221; \u9009\u9879\u5361\uff0c\u786e\u4fdd &#8220;MySQL&#8221; \u670d\u52a1\u5df2\u5f00\u542f\u3002 2. \u7aef\u53e3\u53f7\u51b2\u7a81 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u68c0\u67e5 MySQL \u7684\u7aef\u53e3\u53f7\u662f\u5426\u88ab\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u3002 \u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7aef\u53e3\u53f7\uff1a Windows\uff1anetstat -ano | findstr &#8220;3306&#8221; macOS\/Linux\uff1asudo lsof -i | grep mysqld \u5982\u679c\u7aef\u53e3\u53f7\u88ab\u5360\u7528\uff0c\u8bf7\u66f4\u6539 MySQL \u7aef\u53e3\u53f7\u3002 3. \u6743\u9650\u95ee\u9898 \u786e\u4fdd MySQL \u7528\u6237\u5177\u6709\u542f\u52a8\u548c\u505c\u6b62\u6570\u636e\u5e93\u7684\u6743\u9650\u3002 \u6253\u5f00 PHPStudy \u63a7\u5236\u9762\u677f\uff0c\u70b9\u51fb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-17826","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17826","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=17826"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17826\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=17826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=17826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=17826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}