{"id":166635,"date":"2024-11-05T18:02:22","date_gmt":"2024-11-05T10:02:22","guid":{"rendered":"https:\/\/server.hk\/cnblog\/166635\/"},"modified":"2024-11-05T18:02:23","modified_gmt":"2024-11-05T10:02:23","slug":"%e5%bf%ab%e9%80%9f%e5%ad%b8%e7%bf%92-%e6%95%b8%e6%93%9a%e5%ba%ab2023%e7%b0%a1%e7%89%88%e5%ae%89%e8%a3%9d%e6%8c%87%e5%8d%97-%e6%95%b8%e6%93%9a%e5%ba%ab2023%e7%b0%a1%e7%89%88%e5%ae%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/166635\/","title":{"rendered":"\u5feb\u901f\u5b78\u7fd2\u2014\u2014\u6578\u64da\u5eab2023\u7c21\u7248\u5b89\u88dd\u6307\u5357 (\u6578\u64da\u5eab2023\u7c21\u7248\u5b89\u88dd)"},"content":{"rendered":"<h1 id=\"%e5%bf%ab%e9%80%9f%e5%ad%b8%e7%bf%92-%e6%95%b8%e6%93%9a%e5%ba%ab2023%e7%b0%a1%e7%89%88%e5%ae%89%e8%a3%9d%e6%8c%87%e5%8d%97-DbiamIKrkf\">\u5feb\u901f\u5b78\u7fd2\u2014\u2014\u6578\u64da\u5eab2023\u7c21\u7248\u5b89\u88dd\u6307\u5357<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u4f7f\u7528\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u666e\u904d\u3002\u7121\u8ad6\u662f\u4f01\u696d\u9084\u662f\u500b\u4eba\u958b\u767c\u8005\uff0c\u638c\u63e1\u6578\u64da\u5eab\u7684\u5b89\u88dd\u548c\u7ba1\u7406\u90fd\u662f\u4e00\u9805\u91cd\u8981\u6280\u80fd\u3002\u672c\u6587\u5c07\u63d0\u4f9b\u4e00\u500b\u7c21\u55ae\u6613\u61c2\u7684\u6578\u64da\u5eab\u5b89\u88dd\u6307\u5357\uff0c\u5e6b\u52a9\u60a8\u57282023\u5e74\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<h2 id=\"%e9%81%b8%e6%93%87%e6%95%b8%e6%93%9a%e5%ba%ab%e9%a1%9e%e5%9e%8b-DbiamIKrkf\">\u9078\u64c7\u6578\u64da\u5eab\u985e\u578b<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u985e\u578b\u3002\u5e38\u898b\u7684\u6578\u64da\u5eab\u985e\u578b\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff1a<\/strong>\u5982 MySQL\u3001PostgreSQL \u548c SQLite\uff0c\u9019\u4e9b\u6578\u64da\u5eab\u4f7f\u7528\u8868\u683c\u4f86\u5b58\u5132\u6578\u64da\uff0c\u4e26\u652f\u6301 SQL \u67e5\u8a62\u8a9e\u8a00\u3002<\/li>\n<li><strong>\u975e\u95dc\u4fc2\u578b\u6578\u64da\u5eab\uff1a<\/strong>\u5982 MongoDB \u548c Cassandra\uff0c\u9019\u4e9b\u6578\u64da\u5eab\u4f7f\u7528\u6587\u6a94\u6216\u9375\u503c\u5c0d\u4f86\u5b58\u5132\u6578\u64da\uff0c\u9069\u5408\u8655\u7406\u5927\u898f\u6a21\u7684\u975e\u7d50\u69cb\u5316\u6578\u64da\u3002<\/li>\n<\/ul>\n<p>\u6839\u64da\u60a8\u7684\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u985e\u578b\u5f8c\uff0c\u60a8\u53ef\u4ee5\u9032\u884c\u5b89\u88dd\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab-DbiamIKrkf\">\u5b89\u88dd MySQL \u6578\u64da\u5eab<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-DbiamIKrkf\">\u6b65\u9a5f 1\uff1a\u66f4\u65b0\u7cfb\u7d71<\/h3>\n<pre><code>sudo apt update\nsudo apt upgrade<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e5%ae%89%e8%a3%9d-mysql-DbiamIKrkf\">\u6b65\u9a5f 2\uff1a\u5b89\u88dd MySQL<\/h3>\n<pre><code>sudo apt install mysql-server<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e5%95%9f%e5%8b%95-mysql-%e6%9c%8d%e5%8b%99-DbiamIKrkf\">\u6b65\u9a5f 3\uff1a\u555f\u52d5 MySQL \u670d\u52d9<\/h3>\n<pre><code>sudo systemctl start mysql\nsudo systemctl enable mysql<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4%ef%bc%9a%e5%ae%89%e5%85%a8%e9%85%8d%e7%bd%ae-DbiamIKrkf\">\u6b65\u9a5f 4\uff1a\u5b89\u5168\u914d\u7f6e<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u5efa\u8b70\u57f7\u884c\u5b89\u5168\u914d\u7f6e\u8173\u672c\u4ee5\u589e\u5f37\u5b89\u5168\u6027\uff1a<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>\u6839\u64da\u63d0\u793a\u8a2d\u7f6e root \u5bc6\u78bc\uff0c\u522a\u9664\u533f\u540d\u7528\u6236\uff0c\u7981\u6b62 root \u9060\u7a0b\u767b\u9304\uff0c\u4e26\u522a\u9664\u6e2c\u8a66\u6578\u64da\u5eab\u3002<\/p>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-5%ef%bc%9a%e7%99%bb%e9%8c%84-mysql-DbiamIKrkf\">\u6b65\u9a5f 5\uff1a\u767b\u9304 MySQL<\/h3>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<p>\u8f38\u5165\u60a8\u5728\u5b89\u5168\u914d\u7f6e\u4e2d\u8a2d\u7f6e\u7684\u5bc6\u78bc\uff0c\u5373\u53ef\u9032\u5165 MySQL \u547d\u4ee4\u884c\u754c\u9762\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-postgresql-%e6%95%b8%e6%93%9a%e5%ba%ab-DbiamIKrkf\">\u5b89\u88dd PostgreSQL \u6578\u64da\u5eab<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-DbiamIKrkf\">\u6b65\u9a5f 1\uff1a\u66f4\u65b0\u7cfb\u7d71<\/h3>\n<pre><code>sudo apt update\nsudo apt upgrade<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e5%ae%89%e8%a3%9d-postgresql-DbiamIKrkf\">\u6b65\u9a5f 2\uff1a\u5b89\u88dd PostgreSQL<\/h3>\n<pre><code>sudo apt install postgresql postgresql-contrib<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e5%95%9f%e5%8b%95-postgresql-%e6%9c%8d%e5%8b%99-DbiamIKrkf\">\u6b65\u9a5f 3\uff1a\u555f\u52d5 PostgreSQL \u670d\u52d9<\/h3>\n<pre><code>sudo systemctl start postgresql\nsudo systemctl enable postgresql<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4%ef%bc%9a%e7%99%bb%e9%8c%84-postgresql-DbiamIKrkf\">\u6b65\u9a5f 4\uff1a\u767b\u9304 PostgreSQL<\/h3>\n<pre><code>sudo -i -u postgres\npsql<\/code><\/pre>\n<p>\u9019\u5c07\u4ee5 postgres \u7528\u6236\u8eab\u4efd\u767b\u9304 PostgreSQL\uff0c\u60a8\u53ef\u4ee5\u958b\u59cb\u5275\u5efa\u6578\u64da\u5eab\u548c\u7528\u6236\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-mongodb-%e6%95%b8%e6%93%9a%e5%ba%ab-DbiamIKrkf\">\u5b89\u88dd MongoDB \u6578\u64da\u5eab<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1%ef%bc%9a%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-DbiamIKrkf\">\u6b65\u9a5f 1\uff1a\u66f4\u65b0\u7cfb\u7d71<\/h3>\n<pre><code>sudo apt update\nsudo apt upgrade<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2%ef%bc%9a%e5%b0%8e%e5%85%a5-mongodb-%e5%85%ac%e9%91%b0-DbiamIKrkf\">\u6b65\u9a5f 2\uff1a\u5c0e\u5165 MongoDB \u516c\u9470<\/h3>\n<pre><code>wget -qO - https:\/\/www.mongodb.org\/static\/pgp\/server-5.0.asc | sudo apt-key add -<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3%ef%bc%9a%e6%b7%bb%e5%8a%a0-mongodb-%e5%ad%98%e5%84%b2%e5%ba%ab-DbiamIKrkf\">\u6b65\u9a5f 3\uff1a\u6dfb\u52a0 MongoDB \u5b58\u5132\u5eab<\/h3>\n<pre><code>echo \"deb [ arch=amd64,arm64 ] https:\/\/repo.mongodb.org\/apt\/ubuntu focal\/multiverse amd64 packages\" | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-5.0.list<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4%ef%bc%9a%e5%ae%89%e8%a3%9d-mongodb-DbiamIKrkf\">\u6b65\u9a5f 4\uff1a\u5b89\u88dd MongoDB<\/h3>\n<pre><code>sudo apt update\nsudo apt install mongodb-org<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-5%ef%bc%9a%e5%95%9f%e5%8b%95-mongodb-%e6%9c%8d%e5%8b%99-DbiamIKrkf\">\u6b65\u9a5f 5\uff1a\u555f\u52d5 MongoDB \u670d\u52d9<\/h3>\n<pre><code>sudo systemctl start mongod\nsudo systemctl enable mongod<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-DbiamIKrkf\">\u7e3d\u7d50<\/h2>\n<p>\u672c\u6587\u63d0\u4f9b\u4e86\u4e09\u7a2e\u5e38\u898b\u6578\u64da\u5eab\u7684\u5b89\u88dd\u6307\u5357\uff0c\u5305\u62ec MySQL\u3001PostgreSQL \u548c MongoDB\u3002\u901a\u904e\u9019\u4e9b\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u5728\u60a8\u7684\u4f3a\u670d\u5668\u4e0a\u5b89\u88dd\u548c\u914d\u7f6e\u6578\u64da\u5eab\uff0c\u70ba\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u63d0\u4f9b\u652f\u6301\u3002\u7121\u8ad6\u60a8\u662f\u958b\u767c\u8005\u9084\u662f\u4f01\u696d\u7528\u6236\uff0c\u638c\u63e1\u6578\u64da\u5eab\u7684\u5b89\u88dd\u548c\u7ba1\u7406\u90fd\u662f\u4e00\u9805\u91cd\u8981\u7684\u6280\u80fd\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u4f86\u90e8\u7f72\u60a8\u7684\u6578\u64da\u5eab\u3002\u900f\u904e<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\uff0c\u60a8\u53ef\u4ee5\u7372\u5f97\u66f4\u5feb\u7684\u6578\u64da\u5b58\u53d6\u901f\u5ea6\u548c\u66f4\u7a69\u5b9a\u7684\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5feb\u901f\u5b78\u7fd2\u6578\u64da\u5eab2023\u7c21\u7248\u5b89\u88dd\u6307\u5357\uff0c\u63d0\u4f9b\u7c21\u660e\u6b65\u9a5f\u8207\u6280\u5de7\uff0c\u52a9\u60a8\u8f15\u9b06\u5b8c\u6210\u5b89\u88dd\uff0c\u63d0\u5347\u5de5\u4f5c\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-166635","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/166635","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=166635"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/166635\/revisions"}],"predecessor-version":[{"id":166636,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/166635\/revisions\/166636"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=166635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=166635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=166635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}