{"id":6500,"date":"2024-11-14T14:30:49","date_gmt":"2024-11-14T06:30:49","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6500\/"},"modified":"2024-11-14T14:30:49","modified_gmt":"2024-11-14T06:30:49","slug":"%e6%80%8e%e4%b9%88%e5%88%a0%e9%99%a4mysql%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6500\/","title":{"rendered":"\u600e\u4e48\u5220\u9664mysql\u7684\u6570\u636e\u5e93"},"content":{"rendered":"<blockquote><p>\n  \u5220\u9664 mysql \u6570\u636e\u5e93\uff1a\u4f7f\u7528 drop database \u8bed\u53e5\uff0c\u5982 drop database \u6570\u636e\u5e93\u540d;\u3002\u5982\u679c\u6570\u636e\u5e93\u5305\u542b\u5b50\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528 cascade \u7ea7\u8054\u5220\u9664\uff0c\u5982 drop database \u6570\u636e\u5e93\u540d cascade;\u3002\u5728\u64cd\u4f5c\u524d\uff0c\u786e\u8ba4\u6570\u636e\u5e93\u5185\u5bb9\u5e76\u4e86\u89e3\u5220\u9664\u4e0d\u53ef\u9006\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080517434513490.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u5220\u9664mysql\u7684\u6570\u636e\u5e93\u63d2\u56fe\" alt=\"\u600e\u4e48\u5220\u9664mysql\u7684\u6570\u636e\u5e93\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5220\u9664 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p><strong>\u76f4\u63a5\u5220\u9664<\/strong><\/p>\n<p>\u6700\u7b80\u5355\u7684\u5220\u9664\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 DROP DATABASE \u8bed\u53e5\uff0c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>DROP DATABASE \u6570\u636e\u5e93\u540d;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u5220\u9664\u540d\u4e3a test \u7684\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>DROP DATABASE test;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u7ea7\u8054\u5220\u9664<\/strong><\/p>\n<p>\u5982\u679c\u6570\u636e\u5e93\u5305\u542b\u4efb\u4f55\u8868\u3001\u89c6\u56fe\u6216\u5176\u4ed6\u5bf9\u8c61\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 CASCADE \u9009\u9879\u7ea7\u8054\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>DROP DATABASE \u6570\u636e\u5e93\u540d CASCADE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u5220\u9664\u6570\u636e\u5e93\u4ee5\u53ca\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002<\/p>\n<p><strong>\u786e\u8ba4\u5220\u9664<\/strong><\/p>\n<p>\u5728\u6267\u884c DROP DATABASE \u8bed\u53e5\u4e4b\u524d\uff0c\u5efa\u8bae\u4f7f\u7528 SHOW TABLES \u6216 SHOW DATABASES \u547d\u4ee4\u786e\u8ba4\u60a8\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u53ca\u5176\u5185\u5bb9\u3002<\/p>\n<p><strong>\u6ce8\u610f:<\/strong><\/p>\n<ul>\n<li>\u5220\u9664\u6570\u636e\u5e93\u662f\u4e0d\u53ef\u9006\u7684\u64cd\u4f5c\u3002<\/li>\n<li>\u5982\u679c\u60a8\u4e0d\u5c0f\u5fc3\u5220\u9664\u4e86\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u6062\u590d\u5de5\u5177\uff08\u5982 MySQL Workbench\uff09\u5c1d\u8bd5\u6062\u590d\u5b83\u3002<\/li>\n<li>\u5728\u5220\u9664\u6570\u636e\u5e93\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u4e0d\u518d\u9700\u8981\u8be5\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u5220\u9664\u7684\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>\u5220\u9664 mysql \u6570\u636e\u5e93\uff1a\u4f7f\u7528 drop database \u8bed\u53e5\uff0c\u5982 drop database \u6570\u636e\u5e93\u540d;\u3002\u5982\u679c\u6570\u636e\u5e93\u5305\u542b\u5b50\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528 cascade \u7ea7\u8054\u5220\u9664\uff0c\u5982 drop database \u6570\u636e\u5e93\u540d cascade;\u3002\u5728\u64cd\u4f5c\u524d\uff0c\u786e\u8ba4\u6570\u636e\u5e93\u5185\u5bb9\u5e76\u4e86\u89e3\u5220\u9664\u4e0d\u53ef\u9006\u3002 \u5982\u4f55\u5220\u9664 MySQL \u6570\u636e\u5e93 \u76f4\u63a5\u5220\u9664 \u6700\u7b80\u5355\u7684\u5220\u9664\u6570\u636e\u5e93\u7684\u65b9\u6cd5\u662f\u4f7f\u7528 DROP DATABASE \u8bed\u53e5\uff0c\u8bed\u6cd5\u5982\u4e0b\uff1a DROP DATABASE \u6570\u636e\u5e93\u540d; \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u8981\u5220\u9664\u540d\u4e3a test \u7684\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a DROP DATABASE test; \u767b\u5f55\u540e\u590d\u5236 \u7ea7\u8054\u5220\u9664 \u5982\u679c\u6570\u636e\u5e93\u5305\u542b\u4efb\u4f55\u8868\u3001\u89c6\u56fe\u6216\u5176\u4ed6\u5bf9\u8c61\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 CASCADE \u9009\u9879\u7ea7\u8054\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a DROP DATABASE \u6570\u636e\u5e93\u540d CASCADE; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u5220\u9664\u6570\u636e\u5e93\u4ee5\u53ca\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002 \u786e\u8ba4\u5220\u9664 \u5728\u6267\u884c DROP DATABASE \u8bed\u53e5\u4e4b\u524d\uff0c\u5efa\u8bae\u4f7f\u7528 SHOW TABLES \u6216 SHOW DATABASES \u547d\u4ee4\u786e\u8ba4\u60a8\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u53ca\u5176\u5185\u5bb9\u3002 [&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-6500","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6500","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=6500"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6500\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}