{"id":6442,"date":"2024-11-14T11:27:08","date_gmt":"2024-11-14T03:27:08","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6442\/"},"modified":"2024-11-14T11:27:08","modified_gmt":"2024-11-14T03:27:08","slug":"mysql%e6%89%93%e5%bc%80%e6%95%b0%e6%8d%ae%e5%ba%93%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6442\/","title":{"rendered":"mysql\u6253\u5f00\u6570\u636e\u5e93\u547d\u4ee4"},"content":{"rendered":"<blockquote><p>\n  \u8981\u6253\u5f00 mysql \u6570\u636e\u5e93\uff0c\u9700\u8981\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5\uff1b2. \u9009\u62e9\u6570\u636e\u5e93\uff1b3. \u67e5\u770b\u6570\u636e\u5e93\u5185\u5bb9\uff1b4. \u9000\u51fa\u6570\u636e\u5e93\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/02\/2024080220334927448.jpg\" class=\"aligncenter\" title=\"mysql\u6253\u5f00\u6570\u636e\u5e93\u547d\u4ee4\u63d2\u56fe\" alt=\"mysql\u6253\u5f00\u6570\u636e\u5e93\u547d\u4ee4\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u6253\u5f00 MySQL \u6570\u636e\u5e93\uff1f<\/strong><\/p>\n<p>\u8981\u6253\u5f00 MySQL \u6570\u636e\u5e93\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/p>\n<p>\u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff1a<\/p>\n<pre>mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c[\u7528\u6237\u540d] \u548c [\u5bc6\u7801] \u662f\u60a8\u7528\u4e8e\u8bbf\u95ee MySQL \u670d\u52a1\u5668\u7684\u51ed\u636e\u3002<\/p>\n<p><strong>2. \u9009\u62e9\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9009\u62e9\u8981\u6253\u5f00\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>USE [\u6570\u636e\u5e93\u540d];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff0c[\u6570\u636e\u5e93\u540d] \u662f\u60a8\u8981\u6253\u5f00\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002<\/p>\n<p><strong>3. \u67e5\u770b\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8981\u67e5\u770b\u6570\u636e\u5e93\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li> <strong>SHOW TABLES;<\/strong>\uff1a\u663e\u793a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002<\/li>\n<li> <strong>SELECT * FROM [\u8868\u540d];<\/strong>\uff1a\u663e\u793a\u6307\u5b9a\u8868\u4e2d\u7684\u6240\u6709\u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<p><strong>4. \u9000\u51fa\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u5b8c\u6210\u64cd\u4f5c\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u6570\u636e\u5e93\uff1a<\/p>\n<pre>EXIT;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u8981\u6253\u5f00\u540d\u4e3a &#8220;mydb&#8221; \u7684 MySQL \u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>mysql -u root -p\nUSE mydb;\nSHOW TABLES;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u663e\u793a &#8220;mydb&#8221; \u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6253\u5f00\u6570\u636e\u5e93\u547d\u4ee4\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>\u8981\u6253\u5f00 mysql \u6570\u636e\u5e93\uff0c\u9700\u8981\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a1. \u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5\uff1b2. \u9009\u62e9\u6570\u636e\u5e93\uff1b3. \u67e5\u770b\u6570\u636e\u5e93\u5185\u5bb9\uff1b4. \u9000\u51fa\u6570\u636e\u5e93\u3002 \u5982\u4f55\u6253\u5f00 MySQL \u6570\u636e\u5e93\uff1f \u8981\u6253\u5f00 MySQL \u6570\u636e\u5e93\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u5efa\u7acb\u6570\u636e\u5e93\u8fde\u63a5 \u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5ba2\u6237\u7aef\u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\uff1a mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c[\u7528\u6237\u540d] \u548c [\u5bc6\u7801] \u662f\u60a8\u7528\u4e8e\u8bbf\u95ee MySQL \u670d\u52a1\u5668\u7684\u51ed\u636e\u3002 2. \u9009\u62e9\u6570\u636e\u5e93 \u8fde\u63a5\u5230 MySQL \u670d\u52a1\u5668\u540e\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u9009\u62e9\u8981\u6253\u5f00\u7684\u6570\u636e\u5e93\uff1a USE [\u6570\u636e\u5e93\u540d]; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff0c[\u6570\u636e\u5e93\u540d] \u662f\u60a8\u8981\u6253\u5f00\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002 3. \u67e5\u770b\u6570\u636e\u5e93 \u8981\u67e5\u770b\u6570\u636e\u5e93\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a SHOW TABLES;\uff1a\u663e\u793a\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002 SELECT * FROM [\u8868\u540d];\uff1a\u663e\u793a\u6307\u5b9a\u8868\u4e2d\u7684\u6240\u6709\u8bb0\u5f55\u3002 4. \u9000\u51fa\u6570\u636e\u5e93 \u5b8c\u6210\u64cd\u4f5c\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9000\u51fa\u6570\u636e\u5e93\uff1a EXIT; [&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-6442","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6442","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=6442"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6442\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}