{"id":17848,"date":"2024-11-18T17:25:37","date_gmt":"2024-11-18T09:25:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/17848\/"},"modified":"2024-11-18T17:25:37","modified_gmt":"2024-11-18T09:25:37","slug":"phpstudy%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e6%80%8e%e4%b9%88%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/17848\/","title":{"rendered":"phpstudy\u7684\u6570\u636e\u5e93\u600e\u4e48\u7528"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u4f7f\u7528 phpstudy \u4e2d\u7684\u6570\u636e\u5e93\uff1f\u542f\u52a8 phpstudy \u5e76\u6253\u5f00 mysql \u63a7\u5236\u53f0\u3002\u521b\u5efa\u6570\u636e\u5e93\u3001\u7528\u6237\u5e76\u6388\u4e88\u6743\u9650\u3002\u4f7f\u7528 phpmyadmin \u6216\u5176\u4ed6 mysql \u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u6267\u884c sql \u67e5\u8be2\u3001\u521b\u5efa\u8868\u548c\u63d2\u5165\u6570\u636e\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/02\/2024040215002090733.jpg\" class=\"aligncenter\" title=\"phpstudy\u7684\u6570\u636e\u5e93\u600e\u4e48\u7528\u63d2\u56fe\" alt=\"phpstudy\u7684\u6570\u636e\u5e93\u600e\u4e48\u7528\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 phpStudy \u4e2d\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<p>phpStudy\u4f5c\u4e3a\u4e00\u6b3e\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u5185\u7f6e\u4e86\u5e38\u7528\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5982MySQL\u3002\u4e0b\u9762\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 phpStudy \u4e2d\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<p><strong>1. \u542f\u52a8 phpStudy<\/strong><\/p>\n<p>\u6253\u5f00 phpStudy\uff0c\u786e\u4fdd\u5df2\u542f\u52a8 Apache \u548c MySQL \u670d\u52a1\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>2. \u6253\u5f00 MySQL \u63a7\u5236\u53f0<\/strong><\/p>\n<p>\u5728 phpStudy \u63a7\u5236\u9762\u677f\u4e2d\uff0c\u70b9\u51fb &#8220;Tools&#8221; -&gt; &#8220;MySQL 5.7 Admin&#8221;\uff0c\u6253\u5f00 MySQL \u63a7\u5236\u53f0\u3002<\/p>\n<p><strong>3. \u521b\u5efa\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u5728 MySQL \u63a7\u5236\u53f0\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u8bed\u53e5\u521b\u5efa\u65b0\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>CREATE DATABASE \u6570\u636e\u5e93\u540d;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u521b\u5efa\u7528\u6237<\/strong><\/p>\n<p>\u521b\u5efa\u5177\u6709\u9002\u5f53\u6743\u9650\u7684\u7528\u6237\u6765\u8bbf\u95ee\u6570\u636e\u5e93\uff1a<\/p>\n<pre>CREATE USER \u7528\u6237\u540d@'localhost' IDENTIFIED BY '\u5bc6\u7801';\nGRANT ALL PRIVILEGES ON \u6570\u636e\u5e93\u540d.* TO \u7528\u6237\u540d@'localhost';\nFLUSH PRIVILEGES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u8fde\u63a5\u5230\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u6253\u5f00 phpMyAdmin \u6216\u5176\u4ed6 MySQL \u5ba2\u6237\u7aef\u5de5\u5177\uff0c\u8f93\u5165\u4ee5\u4e0b\u4fe1\u606f\u8fde\u63a5\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<ul>\n<li>\u4e3b\u673a\u540d\uff1alocalhost<\/li>\n<li>\u7528\u6237\u540d\uff1a\u521a\u624d\u521b\u5efa\u7684\u7528\u6237<\/li>\n<li>\u5bc6\u7801\uff1a\u521a\u624d\u521b\u5efa\u7684\u5bc6\u7801<\/li>\n<\/ul>\n<p><strong>6. \u4f7f\u7528\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8fde\u63a5\u6210\u529f\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728\u6240\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\u6267\u884c SQL \u67e5\u8be2\u3001\u521b\u5efa\u8868\u548c\u63d2\u5165\u6570\u636e\u4e86\u3002<\/p>\n<p><strong>\u4f7f\u7528\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5728 phpMyAdmin \u4e2d\uff0c\u60a8\u53ef\u4ee5\uff1a<\/p>\n<ul>\n<li>\u5728 &#8220;SQL&#8221; \u9009\u9879\u5361\u4e2d\u6267\u884c SQL \u67e5\u8be2<\/li>\n<li>\u5728 &#8220;\u6570\u636e\u5e93&#8221; \u9009\u9879\u5361\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u6570\u636e\u5e93<\/li>\n<li>\u5728 &#8220;\u8868&#8221; \u9009\u9879\u5361\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u8868<\/li>\n<li>\u5728 &#8220;\u63d2\u5165&#8221; \u9009\u9879\u5361\u4e2d\u5411\u8868\u4e2d\u63d2\u5165\u6570\u636e<\/li>\n<\/ul>\n<p><strong>\u6ce8\u610f\uff1a<\/strong><\/p>\n<ul>\n<li>\u4e0a\u8ff0\u547d\u4ee4\u9002\u7528\u4e8e MySQL 5.7\u3002\u5982\u679c\u60a8\u4f7f\u7528\u4e0d\u540c\u7684 MySQL \u7248\u672c\uff0c\u547d\u4ee4\u53ef\u80fd\u6709\u6240\u4e0d\u540c\u3002<\/li>\n<li>\u8bf7\u786e\u4fdd\u4e3a\u60a8\u7684\u6570\u636e\u5e93\u548c\u7528\u6237\u8bbe\u7f6e\u5f3a\u5bc6\u7801\u4ee5\u63d0\u9ad8\u5b89\u5168\u6027\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7684\u6570\u636e\u5e93\u600e\u4e48\u7528\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>\u5982\u4f55\u4f7f\u7528 phpstudy \u4e2d\u7684\u6570\u636e\u5e93\uff1f\u542f\u52a8 phpstudy \u5e76\u6253\u5f00 mysql \u63a7\u5236\u53f0\u3002\u521b\u5efa\u6570\u636e\u5e93\u3001\u7528\u6237\u5e76\u6388\u4e88\u6743\u9650\u3002\u4f7f\u7528 phpmyadmin \u6216\u5176\u4ed6 mysql \u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002\u6267\u884c sql \u67e5\u8be2\u3001\u521b\u5efa\u8868\u548c\u63d2\u5165\u6570\u636e\u3002 \u5982\u4f55\u4f7f\u7528 phpStudy \u4e2d\u7684\u6570\u636e\u5e93 phpStudy\u4f5c\u4e3a\u4e00\u6b3e\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u5185\u7f6e\u4e86\u5e38\u7528\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u5982MySQL\u3002\u4e0b\u9762\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 phpStudy \u4e2d\u7684\u6570\u636e\u5e93\uff1a 1. \u542f\u52a8 phpStudy \u6253\u5f00 phpStudy\uff0c\u786e\u4fdd\u5df2\u542f\u52a8 Apache \u548c MySQL \u670d\u52a1\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b 2. \u6253\u5f00 MySQL \u63a7\u5236\u53f0 \u5728 phpStudy \u63a7\u5236\u9762\u677f\u4e2d\uff0c\u70b9\u51fb &#8220;Tools&#8221; -&gt; &#8220;MySQL 5.7 Admin&#8221;\uff0c\u6253\u5f00 MySQL \u63a7\u5236\u53f0\u3002 3. \u521b\u5efa\u6570\u636e\u5e93 \u5728 MySQL \u63a7\u5236\u53f0\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u8bed\u53e5\u521b\u5efa\u65b0\u7684\u6570\u636e\u5e93\uff1a CREATE DATABASE \u6570\u636e\u5e93\u540d; \u767b\u5f55\u540e\u590d\u5236 4. \u521b\u5efa\u7528\u6237 \u521b\u5efa\u5177\u6709\u9002\u5f53\u6743\u9650\u7684\u7528\u6237\u6765\u8bbf\u95ee\u6570\u636e\u5e93\uff1a [&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-17848","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17848","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=17848"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17848\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=17848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=17848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=17848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}