{"id":76150,"date":"2024-10-16T04:16:15","date_gmt":"2024-10-15T20:16:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/76150\/"},"modified":"2024-10-16T04:16:15","modified_gmt":"2024-10-15T20:16:15","slug":"mysql%e5%95%9f%e5%8b%95%e5%92%8c%e5%81%9c%e6%ad%a2%e7%9a%84%e5%af%a6%e9%9a%9b%e6%93%8d%e4%bd%9c%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/76150\/","title":{"rendered":"MySQL\u555f\u52d5\u548c\u505c\u6b62\u7684\u5be6\u969b\u64cd\u4f5c\u793a\u4f8b"},"content":{"rendered":"<h1 id=\"mysql%e5%95%9f%e5%8b%95%e5%92%8c%e5%81%9c%e6%ad%a2%e7%9a%84%e5%af%a6%e9%9a%9b%e6%93%8d%e4%bd%9c%e7%a4%ba%e4%be%8b-eaNswPqKiu\">MySQL\u555f\u52d5\u548c\u505c\u6b62\u7684\u5be6\u969b\u64cd\u4f5c\u793a\u4f8b<\/h1>\n<p>MySQL\u662f\u4e00\u500b\u6d41\u884c\u7684\u958b\u6e90\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5404\u7a2e\u61c9\u7528\u7a0b\u5e8f\u4e2d\u3002\u7121\u8ad6\u662f\u958b\u767c\u74b0\u5883\u9084\u662f\u751f\u7522\u74b0\u5883\uff0c\u4e86\u89e3\u5982\u4f55\u555f\u52d5\u548c\u505c\u6b62MySQL\u670d\u52d9\u90fd\u662f\u4e00\u9805\u57fa\u672c\u6280\u80fd\u3002\u672c\u6587\u5c07\u63d0\u4f9b\u4e00\u4e9b\u5be6\u969b\u64cd\u4f5c\u793a\u4f8b\uff0c\u5e6b\u52a9\u7528\u6236\u638c\u63e1MySQL\u7684\u555f\u52d5\u548c\u505c\u6b62\u904e\u7a0b\u3002<\/p>\n<h2 id=\"mysql%e7%9a%84%e5%ae%89%e8%a3%9d-eaNswPqKiu\">MySQL\u7684\u5b89\u88dd<\/h2>\n<p>\u5728\u9032\u884cMySQL\u7684\u555f\u52d5\u548c\u505c\u6b62\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u78ba\u4fddMySQL\u5df2\u7d93\u5b89\u88dd\u5728\u60a8\u7684\u7cfb\u7d71\u4e0a\u3002\u5c0d\u65bc\u5927\u591a\u6578Linux\u767c\u884c\u7248\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get install mysql-server\n<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5MySQL\u7684\u7248\u672c\uff1a<\/p>\n<pre><code>mysql --version\n<\/code><\/pre>\n<h2 id=\"%e5%95%9f%e5%8b%95mysql%e6%9c%8d%e5%8b%99-eaNswPqKiu\">\u555f\u52d5MySQL\u670d\u52d9<\/h2>\n<p>\u5728Linux\u7cfb\u7d71\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u555f\u52d5MySQL\u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl start mysql\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u8f03\u820a\u7684\u7cfb\u7d71\uff0c\u53ef\u80fd\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo service mysql start\n<\/code><\/pre>\n<p>\u555f\u52d5\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5MySQL\u670d\u52d9\u7684\u72c0\u614b\uff1a<\/p>\n<pre><code>sudo systemctl status mysql\n<\/code><\/pre>\n<p>\u5982\u679c\u670d\u52d9\u6b63\u5728\u904b\u884c\uff0c\u60a8\u5c07\u770b\u5230\u985e\u4f3c\u65bc\u4ee5\u4e0b\u7684\u8f38\u51fa\uff1a<\/p>\n<pre><code>\u25cf mysql.service - MySQL Community Server\n   Loaded: loaded (\/lib\/systemd\/system\/mysql.service; enabled; vendor preset: enabled)\n   Active: active (running) ...\n<\/code><\/pre>\n<h2 id=\"%e5%81%9c%e6%ad%a2mysql%e6%9c%8d%e5%8b%99-eaNswPqKiu\">\u505c\u6b62MySQL\u670d\u52d9<\/h2>\n<p>\u7576\u60a8\u9700\u8981\u505c\u6b62MySQL\u670d\u52d9\u6642\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo systemctl stop mysql\n<\/code><\/pre>\n<p>\u540c\u6a23\uff0c\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u8f03\u820a\u7684\u7cfb\u7d71\uff0c\u5247\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre><code>sudo service mysql stop\n<\/code><\/pre>\n<p>\u505c\u6b62\u5f8c\uff0c\u60a8\u53ef\u4ee5\u518d\u6b21\u6aa2\u67e5\u670d\u52d9\u7684\u72c0\u614b\uff0c\u4ee5\u78ba\u4fdd\u5b83\u5df2\u6210\u529f\u505c\u6b62\uff1a<\/p>\n<pre><code>sudo systemctl status mysql\n<\/code><\/pre>\n<p>\u5982\u679c\u670d\u52d9\u5df2\u505c\u6b62\uff0c\u60a8\u5c07\u770b\u5230\u985e\u4f3c\u65bc\u4ee5\u4e0b\u7684\u8f38\u51fa\uff1a<\/p>\n<pre><code>\u25cf mysql.service - MySQL Community Server\n   Loaded: loaded (\/lib\/systemd\/system\/mysql.service; enabled; vendor preset: enabled)\n   Active: inactive (dead) ...\n<\/code><\/pre>\n<h2 id=\"%e9%87%8d%e5%95%9fmysql%e6%9c%8d%e5%8b%99-eaNswPqKiu\">\u91cd\u555fMySQL\u670d\u52d9<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u91cd\u555fMySQL\u670d\u52d9\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\uff1a<\/p>\n<pre><code>sudo systemctl restart mysql\n<\/code><\/pre>\n<p>\u6216\u8005\uff0c\u4f7f\u7528\u8f03\u820a\u7684\u7cfb\u7d71\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo service mysql restart\n<\/code><\/pre>\n<h2 id=\"%e5%b0%8f%e7%b5%90-eaNswPqKiu\">\u5c0f\u7d50<\/h2>\n<p>\u638c\u63e1MySQL\u7684\u555f\u52d5\u548c\u505c\u6b62\u64cd\u4f5c\u5c0d\u65bc\u6578\u64da\u5eab\u7ba1\u7406\u81f3\u95dc\u91cd\u8981\u3002\u7121\u8ad6\u662f\u5728\u958b\u767c\u9084\u662f\u751f\u7522\u74b0\u5883\u4e2d\uff0c\u9019\u4e9b\u57fa\u672c\u547d\u4ee4\u90fd\u80fd\u5e6b\u52a9\u60a8\u6709\u6548\u5730\u7ba1\u7406MySQL\u670d\u52d9\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u548c\u7a69\u5b9a\u6027\u7684\u7528\u6236\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u65b9\u6848\u5c07\u662f\u660e\u667a\u4e4b\u8209\u3002\u7121\u8ad6\u662f <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u9084\u662f\u5176\u4ed6\u985e\u578b\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a>\uff0c\u90fd\u80fd\u70ba\u60a8\u7684\u6578\u64da\u5eab\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3MySQL\u555f\u52d5\u548c\u505c\u6b62\u7684\u5be6\u969b\u64cd\u4f5c\u793a\u4f8b\uff0c\u8f15\u9b06\u638c\u63e1\u6578\u64da\u5eab\u7ba1\u7406\u7684\u57fa\u672c\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-76150","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/76150","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=76150"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/76150\/revisions"}],"predecessor-version":[{"id":76151,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/76150\/revisions\/76151"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=76150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=76150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=76150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}