{"id":96456,"date":"2024-10-20T09:36:17","date_gmt":"2024-10-20T01:36:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/96456\/"},"modified":"2024-10-20T09:36:18","modified_gmt":"2024-10-20T01:36:18","slug":"phpstudy%e9%80%a3%e6%8e%a5%e6%95%b8%e6%93%9a%e5%ba%ab%e6%95%85%e9%9a%9c%e8%a7%a3%e6%b1%ba%e8%a8%98%e9%8c%84-phpstudy-%e7%84%a1%e6%b3%95%e9%80%a3%e6%8e%a5%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/96456\/","title":{"rendered":"PHPStudy\u9023\u63a5\u6578\u64da\u5eab\u6545\u969c\u89e3\u6c7a\u8a18\u9304 (phpstudy \u7121\u6cd5\u9023\u63a5\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"phpstudy%e9%80%a3%e6%8e%a5%e6%95%b8%e6%93%9a%e5%ba%ab%e6%95%85%e9%9a%9c%e8%a7%a3%e6%b1%ba%e8%a8%98%e9%8c%84-phpstudy-%e7%84%a1%e6%b3%95%e9%80%a3%e6%8e%a5%e6%95%b8%e6%93%9a%e5%ba%ab-FHMFjSjOWX\">PHPStudy\u9023\u63a5\u6578\u64da\u5eab\u6545\u969c\u89e3\u6c7a\u8a18\u9304 (phpstudy \u7121\u6cd5\u9023\u63a5\u6578\u64da\u5eab)<\/h1>\n<p>\u5728\u4f7f\u7528PHPStudy\u9032\u884c\u672c\u5730\u958b\u767c\u6642\uff0c\u9023\u63a5\u6578\u64da\u5eab\u7684\u554f\u984c\u662f\u958b\u767c\u8005\u5e38\u5e38\u9047\u5230\u7684\u6311\u6230\u4e4b\u4e00\u3002\u7121\u8ad6\u662f\u56e0\u70ba\u914d\u7f6e\u932f\u8aa4\u9084\u662f\u74b0\u5883\u554f\u984c\uff0c\u9019\u4e9b\u6545\u969c\u90fd\u53ef\u80fd\u5c0e\u81f4\u7121\u6cd5\u6210\u529f\u9023\u63a5\u5230\u6578\u64da\u5eab\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u4e00\u4e9b\u5e38\u898b\u7684\u6545\u969c\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u6709\u6548\u5730\u6392\u67e5\u554f\u984c\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e6%95%85%e9%9a%9c%e5%8f%8a%e5%85%b6%e5%8e%9f%e5%9b%a0-FHMFjSjOWX\">\u5e38\u898b\u6545\u969c\u53ca\u5176\u539f\u56e0<\/h2>\n<h3 id=\"1-%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99%e6%9c%aa%e5%95%9f%e5%8b%95-FHMFjSjOWX\">1. \u6578\u64da\u5eab\u670d\u52d9\u672a\u555f\u52d5<\/h3>\n<p>\u5728PHPStudy\u4e2d\uff0cMySQL\u670d\u52d9\u9700\u8981\u624b\u52d5\u555f\u52d5\u3002\u5982\u679c\u670d\u52d9\u672a\u555f\u52d5\uff0c\u5247\u7121\u6cd5\u9023\u63a5\u5230\u6578\u64da\u5eab\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u6aa2\u67e5\u670d\u52d9\u72c0\u614b\uff1a<\/p>\n<ul>\n<li>\u6253\u958bPHPStudy\u754c\u9762\u3002<\/li>\n<li>\u67e5\u770bMySQL\u670d\u52d9\u7684\u72c0\u614b\uff0c\u78ba\u4fdd\u5176\u986f\u793a\u70ba\u201c\u904b\u884c\u4e2d\u201d\u3002<\/li>\n<li>\u5982\u679c\u672a\u904b\u884c\uff0c\u9ede\u64ca\u201c\u555f\u52d5\u201d\u6309\u9215\u3002<\/li>\n<\/ul>\n<h3 id=\"2-%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e9%8c%af%e8%aa%a4-FHMFjSjOWX\">2. \u914d\u7f6e\u6587\u4ef6\u932f\u8aa4<\/h3>\n<p>PHPStudy\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u80fd\u5b58\u5728\u932f\u8aa4\uff0c\u5c0e\u81f4\u7121\u6cd5\u6b63\u78ba\u9023\u63a5\u6578\u64da\u5eab\u3002\u6aa2\u67e5\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre><code>\n$db_host = 'localhost'; \/\/ \u6578\u64da\u5eab\u4e3b\u6a5f\n$db_user = 'root';      \/\/ \u7528\u6236\u540d\n$db_pass = '';          \/\/ \u5bc6\u78bc\n$db_name = 'test';      \/\/ \u6578\u64da\u5eab\u540d\u7a31\n<\/code><\/pre>\n<p>\u78ba\u4fdd\u9019\u4e9b\u53c3\u6578\u6b63\u78ba\u7121\u8aa4\uff0c\u7279\u5225\u662f\u7528\u6236\u540d\u548c\u5bc6\u78bc\u3002<\/p>\n<h3 id=\"3-%e9%98%b2%e7%81%ab%e7%89%86%e8%a8%ad%e7%bd%ae-FHMFjSjOWX\">3. \u9632\u706b\u7246\u8a2d\u7f6e<\/h3>\n<p>\u5982\u679c\u4f7f\u7528\u7684\u662fWindows\u7cfb\u7d71\uff0c\u9632\u706b\u7246\u53ef\u80fd\u6703\u963b\u6b62MySQL\u7684\u9023\u63a5\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u6aa2\u67e5\u9632\u706b\u7246\u8a2d\u7f6e\uff1a<\/p>\n<ul>\n<li>\u6253\u958b\u63a7\u5236\u9762\u677f\uff0c\u9078\u64c7\u201c\u7cfb\u7d71\u548c\u5b89\u5168\u201d\u3002<\/li>\n<li>\u9ede\u64ca\u201cWindows Defender\u9632\u706b\u7246\u201d\u3002<\/li>\n<li>\u9078\u64c7\u201c\u5141\u8a31\u61c9\u7528\u901a\u904eWindows Defender\u9632\u706b\u7246\u201d\u4e26\u6aa2\u67e5MySQL\u662f\u5426\u5728\u5141\u8a31\u5217\u8868\u4e2d\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%85%e9%9a%9c%e6%8e%92%e6%9f%a5%e6%ad%a5%e9%a9%9f-FHMFjSjOWX\">\u6545\u969c\u6392\u67e5\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e6%b8%ac%e8%a9%a6%e9%80%a3%e6%8e%a5-FHMFjSjOWX\">1. \u6e2c\u8a66\u9023\u63a5<\/h3>\n<p>\u53ef\u4ee5\u4f7f\u7528PHP\u8173\u672c\u4f86\u6e2c\u8a66\u6578\u64da\u5eab\u9023\u63a5\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u6e2c\u8a66\u8173\u672c\uff1a<\/p>\n<pre><code>\nconnect_error) {\n    die(\"\u9023\u63a5\u5931\u6557: \" . $conn-&gt;connect_error);\n}\necho \"\u9023\u63a5\u6210\u529f\";\n$conn-&gt;close();\n?&gt;\n<\/code><\/pre>\n<h3 id=\"2-%e6%9f%a5%e7%9c%8b%e9%8c%af%e8%aa%a4%e6%97%a5%e8%aa%8c-FHMFjSjOWX\">2. \u67e5\u770b\u932f\u8aa4\u65e5\u8a8c<\/h3>\n<p>PHPStudy\u63d0\u4f9b\u4e86\u932f\u8aa4\u65e5\u8a8c\u529f\u80fd\uff0c\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u5feb\u901f\u5b9a\u4f4d\u554f\u984c\u3002\u67e5\u770b\u65e5\u8a8c\u6587\u4ef6\uff0c\u901a\u5e38\u4f4d\u65bcPHPStudy\u7684\u5b89\u88dd\u76ee\u9304\u4e0b\u7684\u201clogs\u201d\u6587\u4ef6\u593e\u4e2d\uff0c\u5c0b\u627e\u8207\u6578\u64da\u5eab\u9023\u63a5\u76f8\u95dc\u7684\u932f\u8aa4\u4fe1\u606f\u3002<\/p>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0phpstudy%e7%89%88%e6%9c%ac-FHMFjSjOWX\">3. \u66f4\u65b0PHPStudy\u7248\u672c<\/h3>\n<p>\u6709\u6642\u5019\uff0c\u820a\u7248\u672c\u7684PHPStudy\u53ef\u80fd\u5b58\u5728bug\uff0c\u5c0e\u81f4\u7121\u6cd5\u9023\u63a5\u6578\u64da\u5eab\u3002\u5efa\u8b70\u5b9a\u671f\u6aa2\u67e5\u4e26\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\uff0c\u4ee5\u7372\u53d6\u6700\u65b0\u7684\u529f\u80fd\u548c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-FHMFjSjOWX\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u4f7f\u7528PHPStudy\u9032\u884c\u958b\u767c\u6642\uff0c\u9023\u63a5\u6578\u64da\u5eab\u7684\u554f\u984c\u53ef\u80fd\u6703\u5f71\u97ff\u958b\u767c\u6548\u7387\u3002\u901a\u904e\u6aa2\u67e5\u6578\u64da\u5eab\u670d\u52d9\u72c0\u614b\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u4ee5\u53ca\u9632\u706b\u7246\u8a2d\u7f6e\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u6709\u6548\u5730\u6392\u67e5\u4e26\u89e3\u6c7a\u9019\u4e9b\u554f\u984c\u3002\u82e5\u60a8\u9700\u8981\u66f4\u7a69\u5b9a\u7684\u74b0\u5883\u4f86\u9032\u884c\u958b\u767c\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u958b\u767c\u63d0\u4f9b\u66f4\u9ad8\u7684\u9748\u6d3b\u6027\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7aPHPStudy\u7121\u6cd5\u9023\u63a5\u6578\u64da\u5eab\u7684\u5e38\u898b\u6545\u969c\uff0c\u63d0\u4f9b\u8a73\u7d30\u6b65\u9a5f\u548c\u6280\u5de7\uff0c\u5e6b\u52a9\u7528\u6236\u5feb\u901f\u6062\u5fa9\u6578\u64da\u5eab\u9023\u63a5\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-96456","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=96456"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96456\/revisions"}],"predecessor-version":[{"id":96457,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96456\/revisions\/96457"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=96456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=96456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=96456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}