{"id":6469,"date":"2024-11-14T15:06:12","date_gmt":"2024-11-14T07:06:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6469\/"},"modified":"2024-11-14T15:06:12","modified_gmt":"2024-11-14T07:06:12","slug":"%e6%80%8e%e4%b9%88%e6%96%b0%e5%bb%ba%e4%b8%80%e4%b8%aamysql%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6469\/","title":{"rendered":"\u600e\u4e48\u65b0\u5efa\u4e00\u4e2amysql\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u521b\u5efa\u4e00\u4e2a\u65b0 mysql \u6570\u636e\u5e93\uff1a\u767b\u5f55 mysql \u670d\u52a1\u5668\u3002\u4f7f\u7528 create database [db_name]; \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002\u4f7f\u7528 show databases; \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u5e93\u662f\u5426\u5df2\u521b\u5efa\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080508094727199.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u65b0\u5efa\u4e00\u4e2amysql\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"\u600e\u4e48\u65b0\u5efa\u4e00\u4e2amysql\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u65b0\u5efa\u4e00\u4e2a MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 MySQL \u6570\u636e\u5e93\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u5373\u53ef\u5b8c\u6210\uff1a<\/p>\n<p><strong>1. \u767b\u5f55 MySQL<\/strong><\/p>\n<p>\u4f7f\u7528\u60a8\u7684 MySQL \u7528\u6237\u540d\u548c\u5bc6\u7801\u767b\u5f55 MySQL \u670d\u52a1\u5668\u3002<\/p>\n<pre>mysql -u username -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u521b\u5efa\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 CREATE DATABASE \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002\u6570\u636e\u5e93\u540d\u79f0\u66ff\u6362\u4e3a <strong>[db_name]<\/strong>\u3002<\/p>\n<pre>CREATE DATABASE [db_name];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u9a8c\u8bc1\u521b\u5efa<\/strong><\/p>\n<p>\u4f7f\u7528 SHOW DATABASES; \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u5e93\u662f\u5426\u5df2\u521b\u5efa\u3002<\/p>\n<pre>SHOW DATABASES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u60a8\u5e94\u8be5\u4f1a\u5728\u7ed3\u679c\u4e2d\u770b\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93 <strong>[db_name]<\/strong>\u3002<\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u4ee5\u4e0b\u793a\u4f8b\u6f14\u793a\u4e86\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a &#8220;my_database&#8221; \u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>mysql -u username -p\n\nCREATE DATABASE my_database;\n\nSHOW DATABASES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8f93\u51fa\uff1a<\/p>\n<pre>+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n| sys                |\n| my_database        |\n+--------------------+<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li>\u786e\u4fdd\u60a8\u5177\u6709\u521b\u5efa\u6570\u636e\u5e93\u7684\u6a29\u9650\u3002<\/li>\n<li>\u6570\u636e\u5e93\u540d\u79f0\u5bf9\u5927\u5c0f\u5199\u654f\u611f\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd\u8f93\u5165\u6b63\u786e\u3002<\/li>\n<li>\u60a8\u53ef\u4ee5\u4f7f\u7528 USE [db_name]; \u8bed\u53e5\u5207\u6362\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u65b0\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\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>\u521b\u5efa\u4e00\u4e2a\u65b0 mysql \u6570\u636e\u5e93\uff1a\u767b\u5f55 mysql \u670d\u52a1\u5668\u3002\u4f7f\u7528 create database [db_name]; \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002\u4f7f\u7528 show databases; \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u5e93\u662f\u5426\u5df2\u521b\u5efa\u3002 \u5982\u4f55\u65b0\u5efa\u4e00\u4e2a MySQL \u6570\u636e\u5e93 \u521b\u5efa\u4e00\u4e2a\u65b0\u7684 MySQL \u6570\u636e\u5e93\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u5373\u53ef\u5b8c\u6210\uff1a 1. \u767b\u5f55 MySQL \u4f7f\u7528\u60a8\u7684 MySQL \u7528\u6237\u540d\u548c\u5bc6\u7801\u767b\u5f55 MySQL \u670d\u52a1\u5668\u3002 mysql -u username -p \u767b\u5f55\u540e\u590d\u5236 2. \u521b\u5efa\u6570\u636e\u5e93 \u4f7f\u7528 CREATE DATABASE \u8bed\u53e5\u521b\u5efa\u6570\u636e\u5e93\u3002\u6570\u636e\u5e93\u540d\u79f0\u66ff\u6362\u4e3a [db_name]\u3002 CREATE DATABASE [db_name]; \u767b\u5f55\u540e\u590d\u5236 3. \u9a8c\u8bc1\u521b\u5efa \u4f7f\u7528 SHOW DATABASES; \u8bed\u53e5\u9a8c\u8bc1\u6570\u636e\u5e93\u662f\u5426\u5df2\u521b\u5efa\u3002 SHOW DATABASES; \u767b\u5f55\u540e\u590d\u5236 \u60a8\u5e94\u8be5\u4f1a\u5728\u7ed3\u679c\u4e2d\u770b\u5230\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93 [db_name]\u3002 \u793a\u4f8b\uff1a \u4ee5\u4e0b\u793a\u4f8b\u6f14\u793a\u4e86\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a [&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-6469","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6469","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=6469"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6469\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}