{"id":1775,"date":"2026-02-20T08:40:34","date_gmt":"2026-02-20T00:40:34","guid":{"rendered":"http:\/\/www.dxQerp.cn\/?p=1775"},"modified":"2026-02-20T09:05:29","modified_gmt":"2026-02-20T01:05:29","slug":"mysql-%e5%88%aa%e9%99%a4%e8%b3%87%e6%96%99%e5%ba%ab-%e6%80%8e%e9%ba%bc%e5%81%9a","status":"publish","type":"post","link":"http:\/\/www.dxQerp.cn\/?p=1775","title":{"rendered":"mySQL \u522a\u9664\u8cc7\u6599\u5eab \u600e\u9ebc\u505a"},"content":{"rendered":"<p>\u5728 MySQL \u4e2d\u522a\u9664\u8cc7\u6599\u5eab\u6700\u5e38\u898b\u4e14\u76f4\u63a5\u7684\u65b9\u5f0f\u662f\u4f7f\u7528 DROP DATABASE \u6307\u4ee4\u3002<br \/>\n\u91cd\u8981\u63d0\u9192\uff1a<br \/>\n\u9019\u500b\u6307\u4ee4\u6703\u6c38\u4e45\u522a\u9664\u6574\u500b\u8cc7\u6599\u5eab\uff08\u5305\u542b\u88e1\u9762\u6240\u6709\u8868\u683c\u3001\u8cc7\u6599\u3001\u7d22\u5f15\u3001\u8996\u5716\u7b49\uff09\uff0c\u7121\u6cd5\u5fa9\u539f\uff01<br \/>\n\u8acb\u52d9\u5fc5\u4e09\u601d\uff0c\u4e26\u5148\u505a\u597d\u5099\u4efd\u3002<\/p>\n<p><strong><span style=\"color: #800000;\">\u57fa\u672c\u8a9e\u6cd5<\/span><\/strong><br \/>\nSQLDROP DATABASE \u8cc7\u6599\u5eab\u540d\u7a31;<br \/>\n\u63a8\u85a6\u5beb\u6cd5\uff08\u6700\u5b89\u5168\uff09<br \/>\nSQL&#8211; \u52a0\u4e0a IF EXISTS \u5c31\u4e0d\u6703\u56e0\u70ba\u8cc7\u6599\u5eab\u4e0d\u5b58\u5728\u800c\u51fa\u932f<br \/>\nDROP DATABASE IF EXISTS \u4f60\u7684\u8cc7\u6599\u5eab\u540d\u7a31;<br \/>\n\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f\uff08\u5e38\u7528\u65b9\u5f0f\uff09<br \/>\n\u65b9\u6cd5 1\uff1a\u7528\u547d\u4ee4\u5217\uff08\u6700\u5e38\u898b\uff09<\/p>\n<p>\u5148\u767b\u5165 MySQL\uff08\u7528\u6709 DROP \u6b0a\u9650\u7684\u5e33\u865f\uff0c\u901a\u5e38\u662f root\uff09<\/p>\n<p>Bashmysql -u root -p<br \/>\n# \u8f38\u5165\u5bc6\u78bc\u5f8c\u9032\u5165 mysql&gt;<\/p>\n<p>\u67e5\u770b\u76ee\u524d\u6709\u54ea\u4e9b\u8cc7\u6599\u5eab\uff08\u5efa\u8b70\u5148\u78ba\u8a8d\uff09<\/p>\n<p>SQLSHOW DATABASES;<\/p>\n<p>\u57f7\u884c\u522a\u9664\uff08\u8a18\u5f97\u6539\u6210\u4f60\u771f\u6b63\u7684\u8cc7\u6599\u5eab\u540d\u7a31\uff09<\/p>\n<p>SQLDROP DATABASE IF EXISTS test_db;<br \/>\n&#8212; \u6216<br \/>\nDROP DATABASE myproject2025;<\/p>\n<p>\u518d\u6b21\u78ba\u8a8d\u662f\u5426\u5df2\u522a\u9664<\/p>\n<p>SQLSHOW DATABASES;<\/p>\n<h3 dir=\"auto\"><span style=\"color: #800000;\">\u984d\u5916\u5efa\u8b70<\/span>\uff08\u5c24\u5176\u662f roundcube \u5b89\u88dd\u6642\uff09<\/h3>\n<p dir=\"auto\">Roundcube \u5b98\u65b9\u5b89\u88dd\u5efa\u8b70\u7684\u8a9e\u6cd5\u901a\u5e38\u662f\u9019\u6a23\u5beb\u7684\uff08\u6bd4\u8f03\u5b89\u5168\uff09\uff1a<\/p>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>SQL<\/div>\n<div>\n<pre tabindex=\"0\"><code>CREATE USER 'roundcube'@'localhost' IDENTIFIED BY '??????????';\r\nGRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'localhost';\r\nFLUSH PRIVILEGES;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p dir=\"auto\">\u6216\u662f\u7528\u66f4\u73fe\u4ee3\u7684\u5beb\u6cd5\uff08MariaDB 10.2+ \/ MySQL 8+ \u76f8\u5bb9\uff09\uff1a<\/p>\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>\n<div>SQL<\/div>\n<div>\n<pre tabindex=\"0\"><code>CREATE USER IF NOT EXISTS 'roundcube'@'localhost' \r\nIDENTIFIED WITH mysql_native_password \r\nBY '????????????';<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 MySQL \u4e2d\u522a\u9664\u8cc7\u6599\u5eab\u6700\u5e38\u898b\u4e14\u76f4\u63a5\u7684\u65b9\u5f0f\u662f\u4f7f\u7528 DROP DATABASE \u6307\u4ee4\u3002 \u91cd\u8981\u63d0\u9192\uff1a \u9019\u500b\u6307\u4ee4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,41],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1775"}],"collection":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1775"}],"version-history":[{"count":4,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1775\/revisions"}],"predecessor-version":[{"id":1784,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1775\/revisions\/1784"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1775"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}