{"id":6509,"date":"2024-11-14T12:12:49","date_gmt":"2024-11-14T04:12:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6509\/"},"modified":"2024-11-14T12:12:49","modified_gmt":"2024-11-14T04:12:49","slug":"%e6%80%8e%e4%b9%88%e5%88%a0%e9%99%a4mysql%e9%87%8d%e5%a4%8d%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6509\/","title":{"rendered":"\u600e\u4e48\u5220\u9664mysql\u91cd\u590d\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5982\u4f55\u5220\u9664 mysql \u91cd\u590d\u6570\u636e\u5e93\u67e5\u627e\u91cd\u590d\u6570\u636e\u5e93\uff08\u4f7f\u7528 show databases \u547d\u4ee4\uff09\u3002\u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\uff08\u4f7f\u7528 use database \u547d\u4ee4\uff09\u3002\u5220\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\uff08\u4f7f\u7528 drop table \u547d\u4ee4\uff09\u3002\u5220\u9664\u91cd\u590d\u6570\u636e\u5e93\uff08\u4f7f\u7528 drop database \u547d\u4ee4\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080517522541946.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5220\u9664mysql\u91cd\u590d\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"\u600e\u4e48\u5220\u9664mysql\u91cd\u590d\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5220\u9664 MySQL \u91cd\u590d\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u8981\u5220\u9664 MySQL \u91cd\u590d\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u627e\u51fa\u91cd\u590d\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528 SHOW DATABASES \u547d\u4ee4\uff1a<\/strong>\u6b64\u547d\u4ee4\u5c06\u663e\u793a\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\u3002<\/li>\n<li> <strong>\u68c0\u67e5\u6570\u636e\u5e93\u540d\u79f0\uff1a<\/strong>\u67e5\u627e\u91cd\u590d\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002<\/li>\n<\/ul>\n<p><strong>2. \u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528 USE DATABASE \u547d\u4ee4\uff1a<\/strong>\u9009\u62e9\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>3. \u5220\u9664\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528 DROP TABLE \u547d\u4ee4\uff1a<\/strong>\u4f9d\u6b21\u5220\u9664\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002<\/li>\n<\/ul>\n<p><strong>4. \u5220\u9664\u6570\u636e\u5e93<\/strong><\/p>\n<ul>\n<li> <strong>\u4f7f\u7528 DROP DATABASE \u547d\u4ee4\uff1a<\/strong>\u5220\u9664\u6307\u5b9a\u7684\u6570\u636e\u5e93\u3002<\/li>\n<\/ul>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5047\u8bbe\u6709\u4e24\u4e2a\u91cd\u590d\u7684\u6570\u636e\u5e93\u540d\u4e3a &#8220;my_db&#8221;\u3002<\/p>\n<pre>SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| my_db             |\n| my_db2            |\n| mysql              |\n| performance_schema |\n| sys               |\n+--------------------+<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8981\u5220\u9664 &#8220;my_db2&#8221; \u6570\u636e\u5e93\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<pre>USE my_db2;\nDROP TABLE *;\nDROP DATABASE my_db2;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6267\u884c\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u91cd\u590d\u7684\u6570\u636e\u5e93 &#8220;my_db2&#8221; \u5c06\u88ab\u5220\u9664\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5220\u9664\u91cd\u590d\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>\u5982\u4f55\u5220\u9664 mysql \u91cd\u590d\u6570\u636e\u5e93\u67e5\u627e\u91cd\u590d\u6570\u636e\u5e93\uff08\u4f7f\u7528 show databases \u547d\u4ee4\uff09\u3002\u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\uff08\u4f7f\u7528 use database \u547d\u4ee4\uff09\u3002\u5220\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\uff08\u4f7f\u7528 drop table \u547d\u4ee4\uff09\u3002\u5220\u9664\u91cd\u590d\u6570\u636e\u5e93\uff08\u4f7f\u7528 drop database \u547d\u4ee4\uff09\u3002 \u5982\u4f55\u5220\u9664 MySQL \u91cd\u590d\u6570\u636e\u5e93 \u8981\u5220\u9664 MySQL \u91cd\u590d\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u627e\u51fa\u91cd\u590d\u7684\u6570\u636e\u5e93 \u4f7f\u7528 SHOW DATABASES \u547d\u4ee4\uff1a\u6b64\u547d\u4ee4\u5c06\u663e\u793a\u6240\u6709\u6570\u636e\u5e93\u7684\u5217\u8868\u3002 \u68c0\u67e5\u6570\u636e\u5e93\u540d\u79f0\uff1a\u67e5\u627e\u91cd\u590d\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002 2. \u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93 \u4f7f\u7528 USE DATABASE \u547d\u4ee4\uff1a\u9009\u62e9\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u3002 3. \u5220\u9664\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868 \u4f7f\u7528 DROP TABLE \u547d\u4ee4\uff1a\u4f9d\u6b21\u5220\u9664\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u8868\u3002 4. \u5220\u9664\u6570\u636e\u5e93 \u4f7f\u7528 DROP DATABASE \u547d\u4ee4\uff1a\u5220\u9664\u6307\u5b9a\u7684\u6570\u636e\u5e93\u3002 \u793a\u4f8b\uff1a \u5047\u8bbe\u6709\u4e24\u4e2a\u91cd\u590d\u7684\u6570\u636e\u5e93\u540d\u4e3a &#8220;my_db&#8221;\u3002 SHOW DATABASES; +&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+ | Database | [&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-6509","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6509","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=6509"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6509\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}