{"id":164293,"date":"2024-11-05T06:39:24","date_gmt":"2024-11-04T22:39:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/164293\/"},"modified":"2024-11-05T06:39:25","modified_gmt":"2024-11-04T22:39:25","slug":"%e7%b7%8a%e6%80%a5%e6%95%99%e7%a8%8b%ef%bc%9a%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%9b%e4%ba%86%e6%80%8e%e9%ba%bc%e5%95%9f%e5%8b%95%ef%bc%9f-%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%9b%e4%ba%86%e5%a6%82%e4%bd%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/164293\/","title":{"rendered":"\u7dca\u6025\u6559\u7a0b\uff1a\u6578\u64da\u5eab\u639b\u4e86\u600e\u9ebc\u555f\u52d5\uff1f (\u6578\u64da\u5eab\u639b\u4e86\u5982\u4f55\u555f\u52d5)"},"content":{"rendered":"<h1 id=\"%e7%b7%8a%e6%80%a5%e6%95%99%e7%a8%8b%ef%bc%9a%e6%95%b8%e6%93%9a%e5%ba%ab%e6%8e%9b%e4%ba%86%e6%80%8e%e9%ba%bc%e5%95%9f%e5%8b%95%ef%bc%9f-HDIAmmjSoV\">\u7dca\u6025\u6559\u7a0b\uff1a\u6578\u64da\u5eab\u639b\u4e86\u600e\u9ebc\u555f\u52d5\uff1f<\/h1>\n<p>\u5728\u73fe\u4ee3\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u6578\u64da\u5eab\u662f\u61c9\u7528\u7a0b\u5e8f\u548c\u7db2\u7ad9\u7684\u6838\u5fc3\u7d44\u4ef6\u4e4b\u4e00\u3002\u7576\u6578\u64da\u5eab\u51fa\u73fe\u6545\u969c\u6216\u7121\u6cd5\u555f\u52d5\u6642\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u696d\u52d9\u904b\u71df\u53d7\u5230\u56b4\u91cd\u5f71\u97ff\u3002\u672c\u6587\u5c07\u63d0\u4f9b\u4e00\u4e9b\u5e38\u898b\u7684\u6545\u969c\u6392\u9664\u6b65\u9a5f\uff0c\u5e6b\u52a9\u60a8\u5728\u6578\u64da\u5eab\u639b\u6389\u7684\u60c5\u6cc1\u4e0b\u8fc5\u901f\u6062\u5fa9\u670d\u52d9\u3002<\/p>\n<h2 id=\"1-%e7%a2%ba%e8%aa%8d%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99%e7%8b%80%e6%85%8b-HDIAmmjSoV\">1. \u78ba\u8a8d\u6578\u64da\u5eab\u670d\u52d9\u72c0\u614b<\/h2>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u8a8d\u6578\u64da\u5eab\u670d\u52d9\u662f\u5426\u771f\u7684\u505c\u6b62\u904b\u884c\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u670d\u52d9\u72c0\u614b\uff1a<\/p>\n<pre><code>systemctl status mysql<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f PostgreSQL\uff0c\u5247\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre><code>systemctl status postgresql<\/code><\/pre>\n<p>\u5982\u679c\u670d\u52d9\u986f\u793a\u70ba\u201cinactive\u201d\u6216\u201cfailed\u201d\uff0c\u5247\u9700\u8981\u91cd\u65b0\u555f\u52d5\u670d\u52d9\u3002<\/p>\n<h2 id=\"2-%e9%87%8d%e6%96%b0%e5%95%9f%e5%8b%95%e6%95%b8%e6%93%9a%e5%ba%ab%e6%9c%8d%e5%8b%99-HDIAmmjSoV\">2. \u91cd\u65b0\u555f\u52d5\u6578\u64da\u5eab\u670d\u52d9<\/h2>\n<p>\u5982\u679c\u78ba\u8a8d\u6578\u64da\u5eab\u670d\u52d9\u5df2\u505c\u6b62\uff0c\u60a8\u53ef\u4ee5\u5617\u8a66\u91cd\u65b0\u555f\u52d5\u5b83\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo systemctl restart mysql<\/code><\/pre>\n<p>\u5c0d\u65bc PostgreSQL\uff0c\u5247\u4f7f\u7528\uff1a<\/p>\n<pre><code>sudo systemctl restart postgresql<\/code><\/pre>\n<p>\u91cd\u65b0\u555f\u52d5\u5f8c\uff0c\u518d\u6b21\u6aa2\u67e5\u670d\u52d9\u72c0\u614b\u4ee5\u78ba\u4fdd\u5176\u6b63\u5e38\u904b\u884c\u3002<\/p>\n<h2 id=\"3-%e6%aa%a2%e6%9f%a5%e6%97%a5%e8%aa%8c%e6%96%87%e4%bb%b6-HDIAmmjSoV\">3. \u6aa2\u67e5\u65e5\u8a8c\u6587\u4ef6<\/h2>\n<p>\u5982\u679c\u6578\u64da\u5eab\u4ecd\u7136\u7121\u6cd5\u555f\u52d5\uff0c\u6aa2\u67e5\u65e5\u8a8c\u6587\u4ef6\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u65e5\u8a8c\u6587\u4ef6\u901a\u5e38\u4f4d\u65bc\u4ee5\u4e0b\u8def\u5f91\uff1a<\/p>\n<ul>\n<li>MySQL: <code>\/var\/log\/mysql\/error.log<\/code><\/li>\n<li>PostgreSQL: <code>\/var\/log\/postgresql\/postgresql--main.log<\/code><\/li>\n<\/ul>\n<p>\u901a\u904e\u67e5\u770b\u65e5\u8a8c\u6587\u4ef6\uff0c\u60a8\u53ef\u4ee5\u7372\u5f97\u6709\u95dc\u6545\u969c\u7684\u5177\u9ad4\u4fe1\u606f\uff0c\u9019\u5c07\u5e6b\u52a9\u60a8\u9032\u4e00\u6b65\u6392\u67e5\u554f\u984c\u3002<\/p>\n<h2 id=\"4-%e6%aa%a2%e6%9f%a5%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6-HDIAmmjSoV\">4. \u6aa2\u67e5\u914d\u7f6e\u6587\u4ef6<\/h2>\n<p>\u6709\u6642\u5019\uff0c\u6578\u64da\u5eab\u7121\u6cd5\u555f\u52d5\u7684\u539f\u56e0\u53ef\u80fd\u662f\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u932f\u8aa4\u3002\u6aa2\u67e5\u4ee5\u4e0b\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<ul>\n<li>MySQL: <code>\/etc\/mysql\/my.cnf<\/code><\/li>\n<li>PostgreSQL: <code>\/etc\/postgresql\/\/main\/postgresql.conf<\/code><\/li>\n<\/ul>\n<p>\u78ba\u4fdd\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8a2d\u7f6e\u6b63\u78ba\u7121\u8aa4\uff0c\u7279\u5225\u662f\u7aef\u53e3\u865f\u3001\u6578\u64da\u76ee\u9304\u548c\u7528\u6236\u6b0a\u9650\u7b49\u3002<\/p>\n<h2 id=\"5-%e6%aa%a2%e6%9f%a5%e7%a3%81%e7%a2%9f%e7%a9%ba%e9%96%93-HDIAmmjSoV\">5. \u6aa2\u67e5\u78c1\u789f\u7a7a\u9593<\/h2>\n<p>\u6578\u64da\u5eab\u9700\u8981\u8db3\u5920\u7684\u78c1\u789f\u7a7a\u9593\u4f86\u904b\u884c\u3002\u5982\u679c\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\uff0c\u6578\u64da\u5eab\u53ef\u80fd\u7121\u6cd5\u555f\u52d5\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u78c1\u789f\u7a7a\u9593\uff1a<\/p>\n<pre><code>df -h<\/code><\/pre>\n<p>\u5982\u679c\u767c\u73fe\u67d0\u500b\u5206\u5340\u7684\u7a7a\u9593\u4e0d\u8db3\uff0c\u60a8\u9700\u8981\u6e05\u7406\u4e0d\u5fc5\u8981\u7684\u6587\u4ef6\u6216\u64f4\u5c55\u78c1\u789f\u7a7a\u9593\u3002<\/p>\n<h2 id=\"6-%e6%95%b8%e6%93%9a%e5%ba%ab%e4%bf%ae%e5%be%a9-HDIAmmjSoV\">6. \u6578\u64da\u5eab\u4fee\u5fa9<\/h2>\n<p>\u5982\u679c\u6578\u64da\u5eab\u6587\u4ef6\u640d\u58de\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u9032\u884c\u4fee\u5fa9\u3002\u5c0d\u65bc MySQL\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>mysqlcheck -u root -p --auto-repair --all-databases<\/code><\/pre>\n<p>\u5c0d\u65bc PostgreSQL\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre><code>pg_ctl -D \/var\/lib\/postgresql\/data\/ -m fast -w restart<\/code><\/pre>\n<p>\u9019\u4e9b\u547d\u4ee4\u5c07\u5617\u8a66\u4fee\u5fa9\u640d\u58de\u7684\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"7-%e5%b0%8b%e6%b1%82%e5%b0%88%e6%a5%ad%e5%b9%ab%e5%8a%a9-HDIAmmjSoV\">7. \u5c0b\u6c42\u5c08\u696d\u5e6b\u52a9<\/h2>\n<p>\u5982\u679c\u4ee5\u4e0a\u6b65\u9a5f\u90fd\u7121\u6cd5\u89e3\u6c7a\u554f\u984c\uff0c\u5efa\u8b70\u5c0b\u6c42\u5c08\u696d\u7684\u6280\u8853\u652f\u6301\u3002\u6578\u64da\u5eab\u6545\u969c\u53ef\u80fd\u6d89\u53ca\u8907\u96dc\u7684\u554f\u984c\uff0c\u5c08\u696d\u7684\u6280\u8853\u4eba\u54e1\u80fd\u5920\u63d0\u4f9b\u66f4\u6df1\u5165\u7684\u8a3a\u65b7\u548c\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-HDIAmmjSoV\">\u7e3d\u7d50<\/h2>\n<p>\u6578\u64da\u5eab\u6545\u969c\u53ef\u80fd\u6703\u5c0d\u696d\u52d9\u9020\u6210\u91cd\u5927\u5f71\u97ff\uff0c\u56e0\u6b64\u53ca\u6642\u8655\u7406\u81f3\u95dc\u91cd\u8981\u3002\u901a\u904e\u6aa2\u67e5\u670d\u52d9\u72c0\u614b\u3001\u91cd\u65b0\u555f\u52d5\u670d\u52d9\u3001\u67e5\u770b\u65e5\u8a8c\u6587\u4ef6\u3001\u6aa2\u67e5\u914d\u7f6e\u6587\u4ef6\u3001\u78ba\u4fdd\u78c1\u789f\u7a7a\u9593\u5145\u8db3\u4ee5\u53ca\u9032\u884c\u6578\u64da\u5eab\u4fee\u5fa9\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u5927\u591a\u6578\u554f\u984c\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u6216<a href=\"https:\/\/server.hk\">\u4e91\u670d\u52a1\u5668<\/a>\u4f86\u63d0\u5347\u60a8\u7684\u6578\u64da\u5eab\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7dca\u6025\u6559\u7a0b\uff1a\u5b78\u7fd2\u5982\u4f55\u5feb\u901f\u555f\u52d5\u639b\u6389\u7684\u6578\u64da\u5eab\uff0c\u89e3\u6c7a\u5e38\u898b\u554f\u984c\uff0c\u6062\u5fa9\u6578\u64da\u5eab\u6b63\u5e38\u904b\u884c\uff0c\u78ba\u4fdd\u696d\u52d9\u9023\u7e8c\u6027\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-164293","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/164293","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=164293"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/164293\/revisions"}],"predecessor-version":[{"id":164294,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/164293\/revisions\/164294"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=164293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=164293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=164293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}