{"id":6529,"date":"2024-11-14T12:29:33","date_gmt":"2024-11-14T04:29:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6529\/"},"modified":"2024-11-14T12:29:33","modified_gmt":"2024-11-14T04:29:33","slug":"mysql%e6%95%b0%e6%8d%ae%e5%ba%93%e6%80%8e%e4%b9%88%e5%88%a0%e9%99%a4%e5%b9%b2%e5%87%80","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6529\/","title":{"rendered":"mysql\u6570\u636e\u5e93\u600e\u4e48\u5220\u9664\u5e72\u51c0"},"content":{"rendered":"<blockquote><p>\n  \u8981\u5f7b\u5e95\u5220\u9664 mysql \u6570\u636e\u5e93\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u5e76\u4f7f\u7528 drop database \u547d\u4ee4\u5220\u9664\u5b83\u3002\u5220\u9664\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u5b83\u4eec\u901a\u5e38\u5b58\u50a8\u5728 \/var\/lib\/mysql\/[\u6570\u636e\u5e93\u540d\u79f0] \u76ee\u5f55\u4e2d\u3002\u518d\u6b21\u8fde\u63a5\u5230 mysql \u5e76\u68c0\u67e5\u6570\u636e\u5e93\u662f\u5426\u5df2\u5220\u9664\u3002\u91cd\u542f mysql \u670d\u52a1\u5668\u3002\u6ce8\u610f\uff1a\u5220\u9664\u6570\u636e\u5e93\u4e4b\u524d\u8bf7\u5907\u4efd\u6570\u636e\uff0cdrop database \u547d\u4ee4\u4e0d\u53ef\u6062\u590d\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202408\/05\/2024080519520037028.jpg\" class=\"aligncenter\" title=\"mysql\u6570\u636e\u5e93\u600e\u4e48\u5220\u9664\u5e72\u51c0\u63d2\u56fe\" alt=\"mysql\u6570\u636e\u5e93\u600e\u4e48\u5220\u9664\u5e72\u51c0\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5f7b\u5e95\u5220\u9664 MySQL \u6570\u636e\u5e93<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5de5\u5177\u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u5220\u9664\u6570\u636e\u5e93<\/strong><\/p>\n<p>\u4f7f\u7528 DROP DATABASE \u547d\u4ee4\u5220\u9664\u6570\u636e\u5e93\uff0c\u5176\u4e2d [\u6570\u636e\u5e93\u540d\u79f0] \u662f\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\uff1a<\/p>\n<pre>DROP DATABASE [\u6570\u636e\u5e93\u540d\u79f0];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u5220\u9664\u6570\u636e\u5e93\u6587\u4ef6<\/strong><\/p>\n<p>\u6570\u636e\u5e93\u6587\u4ef6\u901a\u5e38\u5b58\u50a8\u5728\u670d\u52a1\u5668\u7684 \/var\/lib\/\/[\u6570\u636e\u5e93\u540d\u79f0] \u76ee\u5f55\u4e2d\u3002\u5220\u9664\u8fd9\u4e9b\u6587\u4ef6\u4ee5\u5f7b\u5e95\u5220\u9664\u6570\u636e\u5e93\uff1a<\/p>\n<pre>sudo rm -rf \/var\/lib\/mysql\/[\u6570\u636e\u5e93\u540d\u79f0]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u786e\u8ba4\u5220\u9664<\/strong><\/p>\n<p>\u518d\u6b21\u8fde\u63a5\u5230 MySQL \u5e76\u4f7f\u7528 SHOW DATABASES; \u547d\u4ee4\u68c0\u67e5\u6570\u636e\u5e93\u662f\u5426\u5df2\u5220\u9664\u3002\u5b83\u4e0d\u5e94\u8be5\u5728\u5217\u8868\u4e2d\u51fa\u73b0\u3002<\/p>\n<p><strong>\u6b65\u9aa4 5\uff1a\u91cd\u542f MySQL \u670d\u52a1\u5668<\/strong><\/p>\n<p>\u5efa\u8bae\u5728\u5220\u9664\u6570\u636e\u5e93\u540e\u91cd\u542f MySQL \u670d\u52a1\u5668\uff0c\u4ee5\u786e\u4fdd\u6240\u6709\u66f4\u6539\u751f\u6548\uff1a<\/p>\n<pre>sudo service mysql restart<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728\u5220\u9664\u6570\u636e\u5e93\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5907\u4efd\u6240\u6709\u91cd\u8981\u6570\u636e\u3002<\/li>\n<li>DROP DATABASE \u547d\u4ee4\u5c06\u7acb\u5373\u5220\u9664\u6570\u636e\u5e93\u53ca\u5176\u6240\u6709\u5185\u5bb9\uff0c\u4e0d\u53ef\u6062\u590d\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6570\u636e\u5e93\u600e\u4e48\u5220\u9664\u5e72\u51c0\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\u5f7b\u5e95\u5220\u9664 mysql \u6570\u636e\u5e93\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93\u5e76\u4f7f\u7528 drop database \u547d\u4ee4\u5220\u9664\u5b83\u3002\u5220\u9664\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u5b83\u4eec\u901a\u5e38\u5b58\u50a8\u5728 \/var\/lib\/mysql\/[\u6570\u636e\u5e93\u540d\u79f0] \u76ee\u5f55\u4e2d\u3002\u518d\u6b21\u8fde\u63a5\u5230 mysql \u5e76\u68c0\u67e5\u6570\u636e\u5e93\u662f\u5426\u5df2\u5220\u9664\u3002\u91cd\u542f mysql \u670d\u52a1\u5668\u3002\u6ce8\u610f\uff1a\u5220\u9664\u6570\u636e\u5e93\u4e4b\u524d\u8bf7\u5907\u4efd\u6570\u636e\uff0cdrop database \u547d\u4ee4\u4e0d\u53ef\u6062\u590d\u3002 \u5982\u4f55\u5f7b\u5e95\u5220\u9664 MySQL \u6570\u636e\u5e93 \u6b65\u9aa4 1\uff1a\u8fde\u63a5\u5230\u6570\u636e\u5e93 \u4f7f\u7528 MySQL \u547d\u4ee4\u884c\u5de5\u5177\u8fde\u63a5\u5230\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\uff1a mysql -u [\u7528\u6237\u540d] -p [\u5bc6\u7801] \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u5220\u9664\u6570\u636e\u5e93 \u4f7f\u7528 DROP DATABASE \u547d\u4ee4\u5220\u9664\u6570\u636e\u5e93\uff0c\u5176\u4e2d [\u6570\u636e\u5e93\u540d\u79f0] \u662f\u8981\u5220\u9664\u7684\u6570\u636e\u5e93\u7684\u540d\u79f0\uff1a DROP DATABASE [\u6570\u636e\u5e93\u540d\u79f0]; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 3\uff1a\u5220\u9664\u6570\u636e\u5e93\u6587\u4ef6 \u6570\u636e\u5e93\u6587\u4ef6\u901a\u5e38\u5b58\u50a8\u5728\u670d\u52a1\u5668\u7684 \/var\/lib\/\/[\u6570\u636e\u5e93\u540d\u79f0] \u76ee\u5f55\u4e2d\u3002\u5220\u9664\u8fd9\u4e9b\u6587\u4ef6\u4ee5\u5f7b\u5e95\u5220\u9664\u6570\u636e\u5e93\uff1a sudo rm -rf \/var\/lib\/mysql\/[\u6570\u636e\u5e93\u540d\u79f0] \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 4\uff1a\u786e\u8ba4\u5220\u9664 \u518d\u6b21\u8fde\u63a5\u5230 MySQL \u5e76\u4f7f\u7528 [&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-6529","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6529","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=6529"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6529\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}