{"id":182460,"date":"2024-11-09T22:38:19","date_gmt":"2024-11-09T14:38:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/182460\/"},"modified":"2024-11-09T22:38:20","modified_gmt":"2024-11-09T14:38:20","slug":"%e5%8d%87%e7%b4%9a%e6%9c%8d%e5%8b%99%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f%e8%a9%b3%e7%b4%b0%e6%95%99%e7%a8%8b%e8%ab%8b%e7%9c%8b%e6%ad%a4%e6%96%87%ef%bc%88%e5%a6%82%e4%bd%95%e5%8d%87%e7%b4%9a","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/182460\/","title":{"rendered":"\u5347\u7d1a\u670d\u52d9\u5668\u6578\u64da\u5eab\uff1f\u8a73\u7d30\u6559\u7a0b\u8acb\u770b\u6b64\u6587\uff08\u5982\u4f55\u5347\u7d1a\u670d\u52d9\u5668\u4e0a\u7684\u6578\u64da\u5eab\uff09"},"content":{"rendered":"<h1 id=\"%e5%8d%87%e7%b4%9a%e6%9c%8d%e5%8b%99%e5%99%a8%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f%e8%a9%b3%e7%b4%b0%e6%95%99%e7%a8%8b%e8%ab%8b%e7%9c%8b%e6%ad%a4%e6%96%87%ef%bc%88%e5%a6%82%e4%bd%95%e5%8d%87%e7%b4%9a-IqgsnCGeAs\">\u5347\u7d1a\u670d\u52d9\u5668\u6578\u64da\u5eab\uff1f\u8a73\u7d30\u6559\u7a0b\u8acb\u770b\u6b64\u6587\uff08\u5982\u4f55\u5347\u7d1a\u670d\u52d9\u5668\u4e0a\u7684\u6578\u64da\u5eab\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u5c0d\u65bc\u696d\u52d9\u7684\u6210\u529f\u81f3\u95dc\u91cd\u8981\u3002\u96a8\u8457\u696d\u52d9\u7684\u589e\u9577\uff0c\u60a8\u53ef\u80fd\u6703\u767c\u73fe\u539f\u6709\u7684\u6578\u64da\u5eab\u7121\u6cd5\u6eff\u8db3\u9700\u6c42\uff0c\u9019\u6642\u5019\u5347\u7d1a\u6578\u64da\u5eab\u5c31\u6210\u70ba\u4e86\u4e00\u500b\u5fc5\u8981\u7684\u6b65\u9a5f\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728\u670d\u52d9\u5668\u4e0a\u5347\u7d1a\u6578\u64da\u5eab\uff0c\u5e6b\u52a9\u60a8\u9806\u5229\u5b8c\u6210\u9019\u4e00\u904e\u7a0b\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%9c%80%e8%a6%81%e5%8d%87%e7%b4%9a%e6%95%b8%e6%93%9a%e5%ba%ab%ef%bc%9f-IqgsnCGeAs\">\u70ba\u4ec0\u9ebc\u9700\u8981\u5347\u7d1a\u6578\u64da\u5eab\uff1f<\/h2>\n<p>\u5347\u7d1a\u6578\u64da\u5eab\u7684\u539f\u56e0\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6027\u80fd\u63d0\u5347\uff1a<\/strong>\u96a8\u8457\u6578\u64da\u91cf\u7684\u589e\u52a0\uff0c\u820a\u7248\u672c\u7684\u6578\u64da\u5eab\u53ef\u80fd\u7121\u6cd5\u9ad8\u6548\u8655\u7406\u8acb\u6c42\uff0c\u5347\u7d1a\u5f8c\u53ef\u4ee5\u986f\u8457\u63d0\u9ad8\u67e5\u8a62\u901f\u5ea6\u548c\u97ff\u61c9\u6642\u9593\u3002<\/li>\n<li><strong>\u5b89\u5168\u6027\u589e\u5f37\uff1a<\/strong>\u65b0\u7248\u672c\u7684\u6578\u64da\u5eab\u901a\u5e38\u6703\u4fee\u5fa9\u5df2\u77e5\u7684\u5b89\u5168\u6f0f\u6d1e\uff0c\u5347\u7d1a\u53ef\u4ee5\u4fdd\u8b77\u60a8\u7684\u6578\u64da\u4e0d\u53d7\u6f5b\u5728\u5a01\u8105\u3002<\/li>\n<li><strong>\u65b0\u529f\u80fd\u652f\u6301\uff1a<\/strong>\u5347\u7d1a\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6700\u65b0\u7684\u529f\u80fd\u548c\u6280\u8853\uff0c\u9019\u4e9b\u529f\u80fd\u53ef\u80fd\u6703\u5e6b\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u6578\u64da\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%8d%87%e7%b4%9a%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%ba%96%e5%82%99%e5%b7%a5%e4%bd%9c-IqgsnCGeAs\">\u5347\u7d1a\u6578\u64da\u5eab\u7684\u6e96\u5099\u5de5\u4f5c<\/h2>\n<p>\u5728\u9032\u884c\u6578\u64da\u5eab\u5347\u7d1a\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u505a\u597d\u4ee5\u4e0b\u6e96\u5099\uff1a<\/p>\n<ul>\n<li><strong>\u5099\u4efd\u6578\u64da\uff1a<\/strong>\u5728\u5347\u7d1a\u4e4b\u524d\uff0c\u52d9\u5fc5\u5c0d\u73fe\u6709\u6578\u64da\u5eab\u9032\u884c\u5b8c\u6574\u5099\u4efd\uff0c\u4ee5\u9632\u5347\u7d1a\u904e\u7a0b\u4e2d\u51fa\u73fe\u554f\u984c\u3002<\/li>\n<li><strong>\u6aa2\u67e5\u517c\u5bb9\u6027\uff1a<\/strong>\u78ba\u4fdd\u65b0\u7248\u672c\u7684\u6578\u64da\u5eab\u8207\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\u548c\u64cd\u4f5c\u7cfb\u7d71\u517c\u5bb9\u3002<\/li>\n<li><strong>\u95b1\u8b80\u5347\u7d1a\u6587\u6a94\uff1a<\/strong>\u67e5\u770b\u5b98\u65b9\u6587\u6a94\uff0c\u4e86\u89e3\u5347\u7d1a\u904e\u7a0b\u4e2d\u7684\u6ce8\u610f\u4e8b\u9805\u548c\u6b65\u9a5f\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%8d%87%e7%b4%9a%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84%e6%ad%a5%e9%a9%9f-IqgsnCGeAs\">\u5347\u7d1a\u6578\u64da\u5eab\u7684\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e5%82%99%e4%bb%bd%e7%8f%be%e6%9c%89%e6%95%b8%e6%93%9a%e5%ba%ab-IqgsnCGeAs\">1. \u5099\u4efd\u73fe\u6709\u6578\u64da\u5eab<\/h3>\n<pre><code>mysqldump -u username -p database_name &gt; backup_file.sql<\/code><\/pre>\n<p>\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u5099\u4efd\u60a8\u7684\u6578\u64da\u5eab\uff0c\u8acb\u6839\u64da\u5be6\u969b\u60c5\u6cc1\u66ff\u63db\u7528\u6236\u540d\u548c\u6578\u64da\u5eab\u540d\u7a31\u3002<\/p>\n<h3 id=\"2-%e4%b8%8b%e8%bc%89%e6%96%b0%e7%89%88%e6%9c%ac%e7%9a%84%e6%95%b8%e6%93%9a%e5%ba%ab-IqgsnCGeAs\">2. \u4e0b\u8f09\u65b0\u7248\u672c\u7684\u6578\u64da\u5eab<\/h3>\n<p>\u8a2a\u554f\u6578\u64da\u5eab\u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684\u5b89\u88dd\u5305\u3002\u78ba\u4fdd\u9078\u64c7\u9069\u5408\u60a8\u64cd\u4f5c\u7cfb\u7d71\u7684\u7248\u672c\u3002<\/p>\n<h3 id=\"3-%e5%81%9c%e6%ad%a2%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99-IqgsnCGeAs\">3. \u505c\u6b62\u6578\u64da\u5eab\u670d\u52d9<\/h3>\n<pre><code>sudo systemctl stop mysql<\/code><\/pre>\n<p>\u5728\u5347\u7d1a\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u505c\u6b62\u7576\u524d\u904b\u884c\u7684\u6578\u64da\u5eab\u670d\u52d9\u3002<\/p>\n<h3 id=\"4-%e5%ae%89%e8%a3%9d%e6%96%b0%e7%89%88%e6%9c%ac-IqgsnCGeAs\">4. \u5b89\u88dd\u65b0\u7248\u672c<\/h3>\n<p>\u6839\u64da\u4e0b\u8f09\u7684\u5b89\u88dd\u5305\uff0c\u57f7\u884c\u5b89\u88dd\u547d\u4ee4\u3002\u4ee5\u4e0b\u662f\u4ee5 MySQL \u70ba\u4f8b\u7684\u5b89\u88dd\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo dpkg -i mysql-server-version.deb<\/code><\/pre>\n<h3 id=\"5-%e5%8d%87%e7%b4%9a%e6%95%b8%e6%93%9a%e5%ba%ab%e7%b5%90%e6%a7%8b-IqgsnCGeAs\">5. \u5347\u7d1a\u6578\u64da\u5eab\u7d50\u69cb<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u904b\u884c\u5347\u7d1a\u547d\u4ee4\u4ee5\u66f4\u65b0\u6578\u64da\u5eab\u7d50\u69cb\uff1a<\/p>\n<pre><code>sudo mysql_upgrade -u username -p<\/code><\/pre>\n<h3 id=\"6-%e9%87%8d%e5%95%9f%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99-IqgsnCGeAs\">6. \u91cd\u555f\u6578\u64da\u5eab\u670d\u52d9<\/h3>\n<pre><code>sudo systemctl start mysql<\/code><\/pre>\n<p>\u5b8c\u6210\u5347\u7d1a\u5f8c\uff0c\u91cd\u65b0\u555f\u52d5\u6578\u64da\u5eab\u670d\u52d9\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<h3 id=\"7-%e6%b8%ac%e8%a9%a6%e6%95%b8%e6%93%9a%e5%ba%ab-IqgsnCGeAs\">7. \u6e2c\u8a66\u6578\u64da\u5eab<\/h3>\n<p>\u6700\u5f8c\uff0c\u6aa2\u67e5\u6578\u64da\u5eab\u662f\u5426\u6b63\u5e38\u904b\u884c\uff0c\u4e26\u6e2c\u8a66\u61c9\u7528\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n<h2 id=\"%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-IqgsnCGeAs\">\u5e38\u898b\u554f\u984c<\/h2>\n<h3 id=\"%e5%8d%87%e7%b4%9a%e9%81%8e%e7%a8%8b%e4%b8%ad%e5%87%ba%e7%8f%be%e9%8c%af%e8%aa%a4%e8%a9%b2%e6%80%8e%e9%ba%bc%e8%be%a6%ef%bc%9f-IqgsnCGeAs\">\u5347\u7d1a\u904e\u7a0b\u4e2d\u51fa\u73fe\u932f\u8aa4\u8a72\u600e\u9ebc\u8fa6\uff1f<\/h3>\n<p>\u5982\u679c\u5728\u5347\u7d1a\u904e\u7a0b\u4e2d\u9047\u5230\u932f\u8aa4\uff0c\u8acb\u67e5\u770b\u932f\u8aa4\u65e5\u8a8c\u4ee5\u7372\u53d6\u8a73\u7d30\u4fe1\u606f\uff0c\u4e26\u6839\u64da\u63d0\u793a\u9032\u884c\u76f8\u61c9\u7684\u4fee\u5fa9\u3002<\/p>\n<h3 id=\"%e5%a6%82%e4%bd%95%e7%a2%ba%e4%bf%9d%e6%95%b8%e6%93%9a%e7%9a%84%e5%ae%89%e5%85%a8%e6%80%a7%ef%bc%9f-IqgsnCGeAs\">\u5982\u4f55\u78ba\u4fdd\u6578\u64da\u7684\u5b89\u5168\u6027\uff1f<\/h3>\n<p>\u5728\u5347\u7d1a\u4e4b\u524d\uff0c\u52d9\u5fc5\u9032\u884c\u5b8c\u6574\u7684\u6578\u64da\u5099\u4efd\uff0c\u4e26\u5728\u5347\u7d1a\u5f8c\u6aa2\u67e5\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-IqgsnCGeAs\">\u7e3d\u7d50<\/h2>\n<p>\u5347\u7d1a\u670d\u52d9\u5668\u4e0a\u7684\u6578\u64da\u5eab\u662f\u4e00\u500b\u91cd\u8981\u7684\u904e\u7a0b\uff0c\u80fd\u5920\u63d0\u5347\u6027\u80fd\u548c\u5b89\u5168\u6027\u3002\u901a\u904e\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u9806\u5229\u5b8c\u6210\u5347\u7d1a\uff0c\u78ba\u4fdd\u696d\u52d9\u904b\u884c\u7684\u7a69\u5b9a\u6027\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c <a href=\"https:\/\/server.hk\">\u96f2\u670d\u52d9\u5668<\/a> \u7684\u4fe1\u606f\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>\u4e86\u89e3\u5982\u4f55\u5347\u7d1a\u670d\u52d9\u5668\u4e0a\u7684\u6578\u64da\u5eab\uff0c\u7372\u53d6\u8a73\u7d30\u6559\u7a0b\u548c\u6b65\u9a5f\uff0c\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u8207\u6027\u80fd\u63d0\u5347\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-182460","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/182460","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=182460"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/182460\/revisions"}],"predecessor-version":[{"id":182461,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/182460\/revisions\/182461"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=182460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=182460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=182460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}