{"id":185894,"date":"2024-11-11T01:23:19","date_gmt":"2024-11-10T17:23:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/185894\/"},"modified":"2024-11-11T01:23:20","modified_gmt":"2024-11-10T17:23:20","slug":"%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e5%84%b2%e5%ad%98%e6%96%b0%e8%81%9e%e4%b8%8d%e4%ba%8c%e4%b9%8b%e9%81%b8%ef%bc%88%e5%ad%98%e5%84%b2%e6%96%b0%e8%81%9e%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/185894\/","title":{"rendered":"\u6578\u64da\u5eab\uff1a\u5132\u5b58\u65b0\u805e\u4e0d\u4e8c\u4e4b\u9078\uff08\u5b58\u5132\u65b0\u805e\u7684\u6578\u64da\u5eab\uff09"},"content":{"rendered":"<h1 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9a%e5%84%b2%e5%ad%98%e6%96%b0%e8%81%9e%e4%b8%8d%e4%ba%8c%e4%b9%8b%e9%81%b8%ef%bc%88%e5%ad%98%e5%84%b2%e6%96%b0%e8%81%9e%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%89-IHbiiksjMJ\">\u6578\u64da\u5eab\uff1a\u5132\u5b58\u65b0\u805e\u4e0d\u4e8c\u4e4b\u9078\uff08\u5b58\u5132\u65b0\u805e\u7684\u6578\u64da\u5eab\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u4f4d\u5316\u7684\u6642\u4ee3\uff0c\u65b0\u805e\u7684\u5373\u6642\u6027\u548c\u6e96\u78ba\u6027\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u96a8\u8457\u65b0\u805e\u91cf\u7684\u6fc0\u589e\uff0c\u5982\u4f55\u6709\u6548\u5730\u5132\u5b58\u548c\u7ba1\u7406\u9019\u4e9b\u6578\u64da\u6210\u70ba\u4e86\u4e00\u500b\u4e9f\u5f85\u89e3\u6c7a\u7684\u554f\u984c\u3002\u6578\u64da\u5eab\u4f5c\u70ba\u4e00\u7a2e\u9ad8\u6548\u7684\u6578\u64da\u7ba1\u7406\u5de5\u5177\uff0c\u7121\u7591\u662f\u5132\u5b58\u65b0\u805e\u7684\u6700\u4f73\u9078\u64c7\u4e4b\u4e00\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-IHbiiksjMJ\">\u6578\u64da\u5eab\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>\u6578\u64da\u5eab\u662f\u4e00\u7a2e\u6709\u7d44\u7e54\u7684\u6578\u64da\u96c6\u5408\uff0c\u901a\u5e38\u7531\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff08DBMS\uff09\u4f86\u7ba1\u7406\u3002\u5b83\u80fd\u5920\u652f\u6301\u6578\u64da\u7684\u5275\u5efa\u3001\u8b80\u53d6\u3001\u66f4\u65b0\u548c\u522a\u9664\uff08CRUD\uff09\u64cd\u4f5c\u3002\u6578\u64da\u5eab\u7684\u985e\u578b\u591a\u7a2e\u591a\u6a23\uff0c\u5305\u62ec\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff08\u5982MySQL\u3001PostgreSQL\uff09\u548c\u975e\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff08\u5982MongoDB\u3001Cassandra\uff09\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bd%95%e9%81%b8%e6%93%87%e6%95%b8%e6%93%9a%e5%ba%ab%e4%be%86%e5%84%b2%e5%ad%98%e6%96%b0%e8%81%9e-IHbiiksjMJ\">\u70ba\u4f55\u9078\u64c7\u6578\u64da\u5eab\u4f86\u5132\u5b58\u65b0\u805e<\/h2>\n<p>\u5132\u5b58\u65b0\u805e\u7684\u9700\u6c42\u4e3b\u8981\u4f86\u81ea\u65bc\u4ee5\u4e0b\u5e7e\u500b\u65b9\u9762\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u7684\u7d50\u69cb\u5316\uff1a<\/strong>\u65b0\u805e\u6578\u64da\u901a\u5e38\u5305\u542b\u6a19\u984c\u3001\u5167\u5bb9\u3001\u4f5c\u8005\u3001\u6642\u9593\u6233\u7b49\u591a\u500b\u5b57\u6bb5\uff0c\u4f7f\u7528\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u53ef\u4ee5\u8f15\u9b06\u5730\u5c07\u9019\u4e9b\u6578\u64da\u7d50\u69cb\u5316\uff0c\u4fbf\u65bc\u67e5\u8a62\u548c\u7ba1\u7406\u3002<\/li>\n<li><strong>\u9ad8\u6548\u7684\u67e5\u8a62\u80fd\u529b\uff1a<\/strong>\u6578\u64da\u5eab\u63d0\u4f9b\u4e86\u5f37\u5927\u7684\u67e5\u8a62\u8a9e\u8a00\uff08\u5982SQL\uff09\uff0c\u80fd\u5920\u5feb\u901f\u6aa2\u7d22\u7279\u5b9a\u65b0\u805e\uff0c\u9019\u5c0d\u65bc\u65b0\u805e\u6a5f\u69cb\u4f86\u8aaa\u81f3\u95dc\u91cd\u8981\u3002<\/li>\n<li><strong>\u6578\u64da\u7684\u5b89\u5168\u6027\uff1a<\/strong>\u6578\u64da\u5eab\u7cfb\u7d71\u901a\u5e38\u63d0\u4f9b\u591a\u5c64\u6b21\u7684\u5b89\u5168\u6a5f\u5236\uff0c\u80fd\u5920\u6709\u6548\u4fdd\u8b77\u65b0\u805e\u6578\u64da\u4e0d\u88ab\u672a\u7d93\u6388\u6b0a\u7684\u8a2a\u554f\u3002<\/li>\n<li><strong>\u64f4\u5c55\u6027\uff1a<\/strong>\u96a8\u8457\u65b0\u805e\u6578\u91cf\u7684\u589e\u52a0\uff0c\u6578\u64da\u5eab\u80fd\u5920\u8f15\u9b06\u64f4\u5c55\uff0c\u652f\u6301\u66f4\u5927\u7684\u6578\u64da\u5b58\u5132\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%96%b0%e8%81%9e%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e8%a8%ad%e8%a8%88%e8%80%83%e9%87%8f-IHbiiksjMJ\">\u65b0\u805e\u6578\u64da\u5eab\u7684\u8a2d\u8a08\u8003\u91cf<\/h2>\n<p>\u5728\u8a2d\u8a08\u65b0\u805e\u6578\u64da\u5eab\u6642\uff0c\u9700\u8981\u8003\u616e\u4ee5\u4e0b\u5e7e\u500b\u65b9\u9762\uff1a<\/p>\n<h3 id=\"1-%e6%95%b8%e6%93%9a%e6%a8%a1%e5%9e%8b-IHbiiksjMJ\">1. \u6578\u64da\u6a21\u578b<\/h3>\n<p>\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u6a21\u578b\u662f\u8a2d\u8a08\u6578\u64da\u5eab\u7684\u7b2c\u4e00\u6b65\u3002\u5c0d\u65bc\u65b0\u805e\u6578\u64da\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff0c\u5c07\u65b0\u805e\u7684\u5404\u500b\u5c6c\u6027\uff08\u5982\u6a19\u984c\u3001\u5167\u5bb9\u3001\u4f5c\u8005\u7b49\uff09\u8a2d\u8a08\u70ba\u8868\u683c\u4e2d\u7684\u5b57\u6bb5\u3002<\/p>\n<h3 id=\"2-%e6%95%b8%e6%93%9a%e5%ae%8c%e6%95%b4%e6%80%a7-IHbiiksjMJ\">2. \u6578\u64da\u5b8c\u6574\u6027<\/h3>\n<p>\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u662f\u6578\u64da\u5eab\u8a2d\u8a08\u4e2d\u7684\u4e00\u500b\u91cd\u8981\u8003\u91cf\u3002\u53ef\u4ee5\u901a\u904e\u8a2d\u7f6e\u4e3b\u9375\u3001\u5916\u9375\u548c\u7d04\u675f\u689d\u4ef6\u4f86\u4fdd\u8b49\u6578\u64da\u7684\u6b63\u78ba\u6027\u548c\u4e00\u81f4\u6027\u3002<\/p>\n<h3 id=\"3-%e6%95%88%e8%83%bd%e5%84%aa%e5%8c%96-IHbiiksjMJ\">3. \u6548\u80fd\u512a\u5316<\/h3>\n<p>\u96a8\u8457\u6578\u64da\u91cf\u7684\u589e\u9577\uff0c\u67e5\u8a62\u6027\u80fd\u53ef\u80fd\u6703\u53d7\u5230\u5f71\u97ff\u3002\u53ef\u4ee5\u901a\u904e\u5efa\u7acb\u7d22\u5f15\u3001\u5206\u5340\u548c\u7de9\u5b58\u7b49\u6280\u8853\u4f86\u512a\u5316\u67e5\u8a62\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e5%af%a6%e9%9a%9b%e6%a1%88%e4%be%8b%ef%bc%9a%e4%bd%bf%e7%94%a8mysql%e5%84%b2%e5%ad%98%e6%96%b0%e8%81%9e-IHbiiksjMJ\">\u5be6\u969b\u6848\u4f8b\uff1a\u4f7f\u7528MySQL\u5132\u5b58\u65b0\u805e<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684MySQL\u6578\u64da\u5eab\u8a2d\u8a08\u793a\u4f8b\uff0c\u7528\u65bc\u5132\u5b58\u65b0\u805e\u6578\u64da\uff1a<\/p>\n<pre><code>\nCREATE DATABASE news_db;\n\nUSE news_db;\n\nCREATE TABLE articles (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    title VARCHAR(255) NOT NULL,\n    content TEXT NOT NULL,\n    author VARCHAR(100),\n    published_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);\n<\/code><\/pre>\n<p>\u5728\u9019\u500b\u793a\u4f8b\u4e2d\uff0c\u6211\u5011\u5275\u5efa\u4e86\u4e00\u500b\u540d\u70baarticles\u7684\u8868\uff0c\u5305\u542b\u4e86\u65b0\u805e\u7684\u6a19\u984c\u3001\u5167\u5bb9\u3001\u4f5c\u8005\u548c\u767c\u4f48\u6642\u9593\u7b49\u5b57\u6bb5\u3002\u9019\u6a23\u7684\u8a2d\u8a08\u80fd\u5920\u6709\u6548\u5730\u5132\u5b58\u548c\u7ba1\u7406\u65b0\u805e\u6578\u64da\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-IHbiiksjMJ\">\u7d50\u8ad6<\/h2>\n<p>\u6578\u64da\u5eab\u4f5c\u70ba\u5132\u5b58\u65b0\u805e\u7684\u7406\u60f3\u9078\u64c7\uff0c\u5177\u5099\u7d50\u69cb\u5316\u3001\u9ad8\u6548\u67e5\u8a62\u3001\u5b89\u5168\u6027\u548c\u64f4\u5c55\u6027\u7b49\u512a\u52e2\u3002\u96a8\u8457\u65b0\u805e\u884c\u696d\u7684\u767c\u5c55\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u5c07\u5c0d\u65b0\u805e\u6a5f\u69cb\u7684\u904b\u71df\u6548\u7387\u548c\u6578\u64da\u7ba1\u7406\u80fd\u529b\u7522\u751f\u6df1\u9060\u5f71\u97ff\u3002\u5c0d\u65bc\u5e0c\u671b\u5728\u9999\u6e2f\u5c0b\u627e\u53ef\u9760\u7684\u6578\u64da\u5b58\u5132\u89e3\u6c7a\u65b9\u6848\u7684\u7528\u6236\uff0c<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u548c<a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a>\u63d0\u4f9b\u4e86\u9748\u6d3b\u4e14\u9ad8\u6548\u7684\u9078\u64c7\uff0c\u80fd\u5920\u6eff\u8db3\u5404\u7a2e\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u6578\u64da\u5eab\u4f5c\u70ba\u5132\u5b58\u65b0\u805e\u7684\u6700\u4f73\u9078\u64c7\uff0c\u63d0\u4f9b\u9ad8\u6548\u3001\u5b89\u5168\u7684\u65b0\u805e\u7ba1\u7406\u8207\u6aa2\u7d22\u89e3\u6c7a\u65b9\u6848\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-185894","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/185894","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=185894"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/185894\/revisions"}],"predecessor-version":[{"id":185895,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/185894\/revisions\/185895"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=185894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=185894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=185894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}