{"id":174723,"date":"2024-11-07T23:12:23","date_gmt":"2024-11-07T15:12:23","guid":{"rendered":"https:\/\/server.hk\/cnblog\/174723\/"},"modified":"2024-11-07T23:12:24","modified_gmt":"2024-11-07T15:12:24","slug":"%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%8d%b8%e8%bc%89%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-%e6%80%8e%e9%ba%bc%e5%8d%b8%e8%bc%89%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/174723\/","title":{"rendered":"\u5982\u4f55\u5feb\u901f\u5378\u8f09\u6578\u64da\u5eab\uff1f (\u600e\u9ebc\u5378\u8f09\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%8d%b8%e8%bc%89%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-%e6%80%8e%e9%ba%bc%e5%8d%b8%e8%bc%89%e6%95%b8%e6%93%9a%e5%ba%ab-WxruZbqrHU\">\u5982\u4f55\u5feb\u901f\u5378\u8f09\u6578\u64da\u5eab\uff1f (\u600e\u9ebc\u5378\u8f09\u6578\u64da\u5eab)<\/h1>\n<p>\u5728\u6578\u64da\u7ba1\u7406\u7684\u904e\u7a0b\u4e2d\uff0c\u5378\u8f09\u6578\u64da\u5eab\u662f\u4e00\u500b\u5e38\u898b\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f\u56e0\u70ba\u9700\u8981\u91cb\u653e\u8cc7\u6e90\u3001\u66f4\u65b0\u7cfb\u7d71\uff0c\u9084\u662f\u56e0\u70ba\u6578\u64da\u5eab\u4e0d\u518d\u4f7f\u7528\uff0c\u6b63\u78ba\u5730\u5378\u8f09\u6578\u64da\u5eab\u662f\u78ba\u4fdd\u7cfb\u7d71\u7a69\u5b9a\u6027\u548c\u6578\u64da\u5b89\u5168\u7684\u91cd\u8981\u6b65\u9a5f\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5feb\u901f\u5378\u8f09\u6578\u64da\u5eab\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u5be6\u7528\u7684\u793a\u4f8b\u548c\u6ce8\u610f\u4e8b\u9805\u3002<\/p>\n<h2 id=\"%e5%8d%b8%e8%bc%89%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%ba%96%e5%82%99%e5%b7%a5%e4%bd%9c-WxruZbqrHU\">\u5378\u8f09\u6578\u64da\u5eab\u7684\u6e96\u5099\u5de5\u4f5c<\/h2>\n<p>\u5728\u9032\u884c\u6578\u64da\u5eab\u5378\u8f09\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u9032\u884c\u4e00\u4e9b\u6e96\u5099\u5de5\u4f5c\uff1a<\/p>\n<ul>\n<li><strong>\u5099\u4efd\u6578\u64da\uff1a<\/strong>\u5728\u5378\u8f09\u6578\u64da\u5eab\u4e4b\u524d\uff0c\u52d9\u5fc5\u5099\u4efd\u6240\u6709\u91cd\u8981\u6578\u64da\u3002\u9019\u6a23\u53ef\u4ee5\u9632\u6b62\u6578\u64da\u4e1f\u5931\uff0c\u4e26\u5728\u9700\u8981\u6642\u6062\u5fa9\u3002<\/li>\n<li><strong>\u78ba\u8a8d\u4f9d\u8cf4\u6027\uff1a<\/strong>\u6aa2\u67e5\u662f\u5426\u6709\u5176\u4ed6\u61c9\u7528\u7a0b\u5e8f\u6216\u670d\u52d9\u4f9d\u8cf4\u65bc\u8a72\u6578\u64da\u5eab\u3002\u5982\u679c\u6709\uff0c\u5247\u9700\u8981\u5148\u8655\u7406\u9019\u4e9b\u4f9d\u8cf4\u6027\u3002<\/li>\n<li><strong>\u7372\u53d6\u7ba1\u7406\u6b0a\u9650\uff1a<\/strong>\u78ba\u4fdd\u60a8\u64c1\u6709\u8db3\u5920\u7684\u6b0a\u9650\u4f86\u5378\u8f09\u6578\u64da\u5eab\u3002\u901a\u5e38\u9700\u8981\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u7684\u6b0a\u9650\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%8d%b8%e8%bc%89%e4%b8%8d%e5%90%8c%e9%a1%9e%e5%9e%8b%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab-WxruZbqrHU\">\u5378\u8f09\u4e0d\u540c\u985e\u578b\u7684\u6578\u64da\u5eab<\/h2>\n<p>\u4e0d\u540c\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08DBMS\uff09\u6709\u4e0d\u540c\u7684\u5378\u8f09\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u6578\u64da\u5eab\u7684\u5378\u8f09\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-mysql-WxruZbqrHU\">1. MySQL<\/h3>\n<p>\u5728 MySQL \u4e2d\uff0c\u5378\u8f09\u6578\u64da\u5eab\u7684\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n<pre><code>-- \u767b\u9304 MySQL\nmysql -u root -p\n\n-- \u5217\u51fa\u6240\u6709\u6578\u64da\u5eab\nSHOW DATABASES;\n\n-- \u5378\u8f09\u6578\u64da\u5eab\nDROP DATABASE database_name;<\/code><\/pre>\n<p>\u5728\u4e0a\u8ff0\u547d\u4ee4\u4e2d\uff0c\u5c07 <code>database_name<\/code> \u66ff\u63db\u70ba\u60a8\u8981\u5378\u8f09\u7684\u6578\u64da\u5eab\u540d\u7a31\u3002\u57f7\u884c\u6b64\u547d\u4ee4\u5f8c\uff0c\u8a72\u6578\u64da\u5eab\u53ca\u5176\u6240\u6709\u6578\u64da\u5c07\u88ab\u6c38\u4e45\u522a\u9664\u3002<\/p>\n<h3 id=\"2-postgresql-WxruZbqrHU\">2. PostgreSQL<\/h3>\n<p>\u5728 PostgreSQL \u4e2d\uff0c\u5378\u8f09\u6578\u64da\u5eab\u7684\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n<pre><code>-- \u767b\u9304 PostgreSQL\npsql -U postgres\n\n-- \u5217\u51fa\u6240\u6709\u6578\u64da\u5eab\nl\n\n-- \u5378\u8f09\u6578\u64da\u5eab\nDROP DATABASE database_name;<\/code><\/pre>\n<p>\u540c\u6a23\uff0c\u5c07 <code>database_name<\/code> \u66ff\u63db\u70ba\u60a8\u8981\u5378\u8f09\u7684\u6578\u64da\u5eab\u540d\u7a31\u3002\u8acb\u6ce8\u610f\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u6c92\u6709\u5176\u4ed6\u7528\u6236\u9023\u63a5\u5230\u8a72\u6578\u64da\u5eab\u3002<\/p>\n<h3 id=\"3-microsoft-sql-server-WxruZbqrHU\">3. Microsoft SQL Server<\/h3>\n<p>\u5728 Microsoft SQL Server \u4e2d\uff0c\u5378\u8f09\u6578\u64da\u5eab\u7684\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n<pre><code>-- \u4f7f\u7528 SQL Server Management Studio (SSMS)\n-- \u53f3\u9375\u9ede\u64ca\u8981\u5378\u8f09\u7684\u6578\u64da\u5eab\n-- \u9078\u64c7 \"\u522a\u9664\"\n-- \u78ba\u8a8d\u522a\u9664\u64cd\u4f5c<\/code><\/pre>\n<p>\u5728 SSMS \u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u5716\u5f62\u754c\u9762\u8f15\u9b06\u5730\u522a\u9664\u6578\u64da\u5eab\uff0c\u9019\u5c0d\u65bc\u4e0d\u719f\u6089\u547d\u4ee4\u884c\u7684\u7528\u6236\u4f86\u8aaa\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-WxruZbqrHU\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u5378\u8f09\u6578\u64da\u5eab\u6642\uff0c\u8acb\u6ce8\u610f\u4ee5\u4e0b\u5e7e\u9ede\uff1a<\/p>\n<ul>\n<li>\u78ba\u4fdd\u60a8\u5df2\u7d93\u5099\u4efd\u4e86\u6240\u6709\u91cd\u8981\u6578\u64da\uff0c\u56e0\u70ba\u4e00\u65e6\u5378\u8f09\uff0c\u6578\u64da\u5c07\u7121\u6cd5\u6062\u5fa9\u3002<\/li>\n<li>\u5728\u5378\u8f09\u4e4b\u524d\uff0c\u6aa2\u67e5\u662f\u5426\u6709\u5176\u4ed6\u61c9\u7528\u7a0b\u5e8f\u4f9d\u8cf4\u65bc\u8a72\u6578\u64da\u5eab\uff0c\u907f\u514d\u5f71\u97ff\u7cfb\u7d71\u7684\u6b63\u5e38\u904b\u884c\u3002<\/li>\n<li>\u5728\u751f\u7522\u74b0\u5883\u4e2d\uff0c\u5efa\u8b70\u5728\u4f4e\u5cf0\u671f\u9032\u884c\u5378\u8f09\u64cd\u4f5c\uff0c\u4ee5\u6e1b\u5c11\u5c0d\u7528\u6236\u7684\u5f71\u97ff\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-WxruZbqrHU\">\u7e3d\u7d50<\/h2>\n<p>\u5378\u8f09\u6578\u64da\u5eab\u662f\u4e00\u500b\u9700\u8981\u8b39\u614e\u8655\u7406\u7684\u904e\u7a0b\uff0c\u6b63\u78ba\u7684\u6b65\u9a5f\u548c\u6e96\u5099\u5de5\u4f5c\u53ef\u4ee5\u5e6b\u52a9\u60a8\u9806\u5229\u5b8c\u6210\u9019\u4e00\u4efb\u52d9\u3002\u7121\u8ad6\u60a8\u4f7f\u7528\u7684\u662f MySQL\u3001PostgreSQL \u9084\u662f Microsoft SQL Server\uff0c\u4e86\u89e3\u5404\u81ea\u7684\u5378\u8f09\u65b9\u6cd5\u90fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">VPS<\/a> \u548c\u6578\u64da\u5eab\u7ba1\u7406\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u6e90\u548c\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5feb\u901f\u5378\u8f09\u6578\u64da\u5eab\u7684\u6b65\u9a5f\u548c\u6280\u5de7\uff0c\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u4e26\u63d0\u9ad8\u7cfb\u7d71\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-174723","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/174723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=174723"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/174723\/revisions"}],"predecessor-version":[{"id":174724,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/174723\/revisions\/174724"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=174723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=174723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=174723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}