{"id":193303,"date":"2024-11-12T21:03:28","date_gmt":"2024-11-12T13:03:28","guid":{"rendered":"https:\/\/server.hk\/cnblog\/193303\/"},"modified":"2024-11-12T21:03:29","modified_gmt":"2024-11-12T13:03:29","slug":"%e8%99%9b%e6%93%ac%e6%a9%9f%e5%af%a6%e8%b8%90%ef%bc%9a%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8c%87%e5%8d%97-%e5%9c%a8%e8%99%9b%e6%93%ac%e6%a9%9f%e9%87%8c%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/193303\/","title":{"rendered":"\u865b\u64ec\u6a5f\u5be6\u8e10\uff1a\u5b89\u88dd\u6578\u64da\u5eab\u6307\u5357 (\u5728\u865b\u64ec\u6a5f\u91cc\u5b89\u88dd\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"%e8%99%9b%e6%93%ac%e6%a9%9f%e5%af%a6%e8%b8%90%ef%bc%9a%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8c%87%e5%8d%97-KjFRhyjEcI\">\u865b\u64ec\u6a5f\u5be6\u8e10\uff1a\u5b89\u88dd\u6578\u64da\u5eab\u6307\u5357<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4f7f\u7528\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u666e\u904d\u3002\u7121\u8ad6\u662f\u958b\u767c\u61c9\u7528\u7a0b\u5e8f\u9084\u662f\u9032\u884c\u6578\u64da\u5206\u6790\uff0c\u6578\u64da\u5eab\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u96a8\u8457\u865b\u64ec\u5316\u6280\u8853\u7684\u767c\u5c55\uff0c\u8a31\u591a\u7528\u6236\u9078\u64c7\u5728\u865b\u64ec\u6a5f\u4e0a\u5b89\u88dd\u6578\u64da\u5eab\uff0c\u4ee5\u4fbf\u66f4\u9748\u6d3b\u5730\u7ba1\u7406\u8cc7\u6e90\u548c\u74b0\u5883\u3002\u672c\u6587\u5c07\u63d0\u4f9b\u4e00\u500b\u8a73\u7d30\u7684\u6307\u5357\uff0c\u5e6b\u52a9\u60a8\u5728\u865b\u64ec\u6a5f\u4e2d\u5b89\u88dd\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"%e8%99%9b%e6%93%ac%e6%a9%9f%e7%9a%84%e6%ba%96%e5%82%99-KjFRhyjEcI\">\u865b\u64ec\u6a5f\u7684\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u6578\u64da\u5eab\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6e96\u5099\u597d\u865b\u64ec\u6a5f\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u5404\u7a2e\u865b\u64ec\u5316\u5e73\u53f0\uff0c\u5982 VMware\u3001VirtualBox \u6216 KVM\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u6b65\u9a5f\uff1a<\/p>\n<ul>\n<li><strong>\u9078\u64c7\u865b\u64ec\u5316\u5e73\u53f0\uff1a<\/strong>\u6839\u64da\u60a8\u7684\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u865b\u64ec\u5316\u8edf\u4ef6\u3002<\/li>\n<li><strong>\u5275\u5efa\u865b\u64ec\u6a5f\uff1a<\/strong>\u8a2d\u7f6e\u865b\u64ec\u6a5f\u7684\u64cd\u4f5c\u7cfb\u7d71\u3001CPU\u3001\u5167\u5b58\u548c\u786c\u789f\u7a7a\u9593\u7b49\u53c3\u6578\u3002<\/li>\n<li><strong>\u5b89\u88dd\u64cd\u4f5c\u7cfb\u7d71\uff1a<\/strong>\u5728\u865b\u64ec\u6a5f\u4e2d\u5b89\u88dd\u6240\u9700\u7684\u64cd\u4f5c\u7cfb\u7d71\uff0c\u5982 Ubuntu\u3001CentOS \u6216 Windows\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a%e5%ba%ab-KjFRhyjEcI\">\u5b89\u88dd\u6578\u64da\u5eab<\/h2>\n<p>\u5728\u865b\u64ec\u6a5f\u4e0a\u5b89\u88dd\u6578\u64da\u5eab\u7684\u904e\u7a0b\u6703\u56e0\u6578\u64da\u5eab\u985e\u578b\u800c\u7570\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd MySQL \u548c PostgreSQL \u7684\u57fa\u672c\u6b65\u9a5f\u3002<\/p>\n<h3 id=\"%e5%ae%89%e8%a3%9d-mysql-KjFRhyjEcI\">\u5b89\u88dd MySQL<\/h3>\n<p>MySQL \u662f\u4e00\u500b\u6d41\u884c\u7684\u958b\u6e90\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u9069\u5408\u5404\u7a2e\u61c9\u7528\u3002\u4ee5\u4e0b\u662f\u5728 Ubuntu \u7cfb\u7d71\u4e0a\u5b89\u88dd MySQL \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install mysql-server\n<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u555f\u52d5 MySQL \u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl start mysql\nsudo systemctl enable mysql\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u53ef\u4ee5\u904b\u884c\u5b89\u5168\u6027\u8173\u672c\u4f86\u52a0\u5f37 MySQL \u7684\u5b89\u5168\u6027\uff1a<\/p>\n<pre><code>sudo mysql_secure_installation\n<\/code><\/pre>\n<h3 id=\"%e5%ae%89%e8%a3%9d-postgresql-KjFRhyjEcI\">\u5b89\u88dd PostgreSQL<\/h3>\n<p>PostgreSQL \u662f\u53e6\u4e00\u500b\u5f37\u5927\u7684\u958b\u6e90\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u7279\u5225\u9069\u5408\u9700\u8981\u8907\u96dc\u67e5\u8a62\u7684\u61c9\u7528\u3002\u4ee5\u4e0b\u662f\u5728 Ubuntu \u7cfb\u7d71\u4e0a\u5b89\u88dd PostgreSQL \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install postgresql postgresql-contrib\n<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u555f\u52d5 PostgreSQL \u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl start postgresql\nsudo systemctl enable postgresql\n<\/code><\/pre>\n<p>\u8981\u9032\u5165 PostgreSQL \u547d\u4ee4\u884c\u754c\u9762\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo -u postgres psql\n<\/code><\/pre>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e5%9f%ba%e6%9c%ac%e9%85%8d%e7%bd%ae-KjFRhyjEcI\">\u6578\u64da\u5eab\u7684\u57fa\u672c\u914d\u7f6e<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u9032\u884c\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u5eab\u80fd\u5920\u6b63\u5e38\u904b\u884c\u4e26\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n<ul>\n<li><strong>\u5275\u5efa\u6578\u64da\u5eab\uff1a<\/strong>\u4f7f\u7528 SQL \u547d\u4ee4\u5275\u5efa\u65b0\u7684\u6578\u64da\u5eab\u3002<\/li>\n<li><strong>\u8a2d\u7f6e\u7528\u6236\u6b0a\u9650\uff1a<\/strong>\u70ba\u4e0d\u540c\u7684\u7528\u6236\u8a2d\u7f6e\u9069\u7576\u7684\u6b0a\u9650\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b89\u5168\u6027\u3002<\/li>\n<li><strong>\u5099\u4efd\u8207\u6062\u5fa9\uff1a<\/strong>\u5b9a\u671f\u5099\u4efd\u6578\u64da\u5eab\uff0c\u4ee5\u9632\u6b62\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-KjFRhyjEcI\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u865b\u64ec\u6a5f\u4e2d\u5b89\u88dd\u6578\u64da\u5eab\u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\uff0c\u53ea\u9700\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\u5373\u53ef\u5b8c\u6210\u3002\u7121\u8ad6\u60a8\u9078\u64c7 MySQL \u9084\u662f PostgreSQL\uff0c\u9019\u4e9b\u6578\u64da\u5eab\u7cfb\u7d71\u90fd\u80fd\u70ba\u60a8\u7684\u61c9\u7528\u63d0\u4f9b\u5f37\u5927\u7684\u652f\u6301\u3002\u5982\u679c\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u8cc7\u6e90\u6216\u670d\u52d9\uff0c\u8acb\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u63d0\u5347\u60a8\u7684\u865b\u64ec\u6a5f\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728\u865b\u64ec\u6a5f\u4e2d\u5b89\u88dd\u6578\u64da\u5eab\u7684\u8a73\u7d30\u6b65\u9a5f\u8207\u5be6\u8e10\u6307\u5357\uff0c\u8f15\u9b06\u638c\u63e1\u865b\u64ec\u74b0\u5883\u4e2d\u7684\u6578\u64da\u7ba1\u7406\u6280\u5de7\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-193303","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/193303","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=193303"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/193303\/revisions"}],"predecessor-version":[{"id":193304,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/193303\/revisions\/193304"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=193303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=193303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=193303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}