{"id":59557,"date":"2024-10-12T22:56:17","date_gmt":"2024-10-12T14:56:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/59557\/"},"modified":"2024-10-12T22:56:17","modified_gmt":"2024-10-12T14:56:17","slug":"centos-6-9%e6%95%b8%e6%93%9a%e5%ba%ab%e5%af%86%e7%a2%bc%e5%a6%82%e4%bd%95%e8%a8%ad%e7%bd%ae%e5%92%8c%e6%9b%b4%e6%94%b9%ef%bc%9f-centos6-9-%e6%95%b8%e6%93%9a%e5%ba%ab%e5%af%86%e7%a2%bc","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/59557\/","title":{"rendered":"CentOS 6.9\u6578\u64da\u5eab\u5bc6\u78bc\u5982\u4f55\u8a2d\u7f6e\u548c\u66f4\u6539\uff1f (centos6.9 \u6578\u64da\u5eab\u5bc6\u78bc)"},"content":{"rendered":"<h1 id=\"centos-6-9%e6%95%b8%e6%93%9a%e5%ba%ab%e5%af%86%e7%a2%bc%e5%a6%82%e4%bd%95%e8%a8%ad%e7%bd%ae%e5%92%8c%e6%9b%b4%e6%94%b9%ef%bc%9f-KHJcpXzHUB\">CentOS 6.9\u6578\u64da\u5eab\u5bc6\u78bc\u5982\u4f55\u8a2d\u7f6e\u548c\u66f4\u6539\uff1f<\/h1>\n<p>\u5728\u4f7f\u7528CentOS 6.9\u4f5c\u70ba\u4f3a\u670d\u5668\u64cd\u4f5c\u7cfb\u7d71\u6642\uff0c\u6578\u64da\u5eab\u7684\u5b89\u5168\u6027\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u7121\u8ad6\u662fMySQL\u9084\u662fMariaDB\uff0c\u8a2d\u7f6e\u548c\u66f4\u6539\u6578\u64da\u5eab\u5bc6\u78bc\u90fd\u662f\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u7684\u57fa\u672c\u6b65\u9a5f\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728CentOS 6.9\u4e0a\u8a2d\u7f6e\u548c\u66f4\u6539\u6578\u64da\u5eab\u5bc6\u78bc\u3002<\/p>\n<h2 id=\"1-%e5%ae%89%e8%a3%9d%e6%95%b8%e6%93%9a%e5%ba%ab-KHJcpXzHUB\">1. \u5b89\u88dd\u6578\u64da\u5eab<\/h2>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u60a8\u7684CentOS 6.9\u7cfb\u7d71\u4e0a\u5df2\u5b89\u88ddMySQL\u6216MariaDB\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo yum install mysql-server<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5\u6578\u64da\u5eab\u670d\u52d9\uff1a<\/p>\n<pre><code>sudo service mysqld start<\/code><\/pre>\n<h2 id=\"2-%e8%a8%ad%e7%bd%ae%e5%88%9d%e5%a7%8b%e5%af%86%e7%a2%bc-KHJcpXzHUB\">2. \u8a2d\u7f6e\u521d\u59cb\u5bc6\u78bc<\/h2>\n<p>\u5b89\u88ddMySQL\u6216MariaDB\u5f8c\uff0c\u7cfb\u7d71\u6703\u81ea\u52d5\u751f\u6210\u4e00\u500b\u96a8\u6a5f\u7684\u521d\u59cb\u5bc6\u78bc\u3002\u60a8\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u627e\u5230\u9019\u500b\u5bc6\u78bc\uff1a<\/p>\n<pre><code>sudo grep 'temporary password' \/var\/log\/mysqld.log<\/code><\/pre>\n<p>\u8a18\u4e0b\u9019\u500b\u5bc6\u78bc\uff0c\u7136\u5f8c\u4f7f\u7528\u5b83\u767b\u9304\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<p>\u7cfb\u7d71\u6703\u63d0\u793a\u60a8\u8f38\u5165\u5bc6\u78bc\uff0c\u8acb\u8f38\u5165\u525b\u624d\u627e\u5230\u7684\u81e8\u6642\u5bc6\u78bc\u3002<\/p>\n<h2 id=\"3-%e6%9b%b4%e6%94%b9%e6%95%b8%e6%93%9a%e5%ba%ab%e5%af%86%e7%a2%bc-KHJcpXzHUB\">3. \u66f4\u6539\u6578\u64da\u5eab\u5bc6\u78bc<\/h2>\n<p>\u767b\u9304\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u6539root\u7528\u6236\u7684\u5bc6\u78bc\uff1a<\/p>\n<pre><code>ALTER USER 'root'@'localhost' IDENTIFIED BY '\u65b0\u5bc6\u78bc';<\/code><\/pre>\n<p>\u8acb\u5c07\u201c\u65b0\u5bc6\u78bc\u201d\u66ff\u63db\u70ba\u60a8\u5e0c\u671b\u8a2d\u7f6e\u7684\u65b0\u5bc6\u78bc\u3002\u57f7\u884c\u6b64\u547d\u4ee4\u5f8c\uff0c\u60a8\u5c07\u770b\u5230\u4e00\u689d\u6210\u529f\u7684\u6d88\u606f\u3002<\/p>\n<h2 id=\"4-%e8%a8%ad%e7%bd%ae%e5%85%b6%e4%bb%96%e7%94%a8%e6%88%b6%e7%9a%84%e5%af%86%e7%a2%bc-KHJcpXzHUB\">4. \u8a2d\u7f6e\u5176\u4ed6\u7528\u6236\u7684\u5bc6\u78bc<\/h2>\n<p>\u5982\u679c\u60a8\u9700\u8981\u70ba\u5176\u4ed6\u7528\u6236\u8a2d\u7f6e\u6216\u66f4\u6539\u5bc6\u78bc\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>ALTER USER '\u7528\u6236\u540d'@'localhost' IDENTIFIED BY '\u65b0\u5bc6\u78bc';<\/code><\/pre>\n<p>\u540c\u6a23\uff0c\u5c07\u201c\u7528\u6236\u540d\u201d\u548c\u201c\u65b0\u5bc6\u78bc\u201d\u66ff\u63db\u70ba\u76f8\u61c9\u7684\u7528\u6236\u540d\u548c\u5bc6\u78bc\u3002<\/p>\n<h2 id=\"5-%e7%a2%ba%e8%aa%8d%e5%af%86%e7%a2%bc%e6%9b%b4%e6%94%b9-KHJcpXzHUB\">5. \u78ba\u8a8d\u5bc6\u78bc\u66f4\u6539<\/h2>\n<p>\u70ba\u4e86\u78ba\u4fdd\u5bc6\u78bc\u5df2\u6210\u529f\u66f4\u6539\uff0c\u60a8\u53ef\u4ee5\u5617\u8a66\u4f7f\u7528\u65b0\u5bc6\u78bc\u767b\u9304\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>mysql -u root -p<\/code><\/pre>\n<p>\u8f38\u5165\u65b0\u5bc6\u78bc\u5f8c\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u6210\u529f\u767b\u9304\u3002<\/p>\n<h2 id=\"6-%e5%af%86%e7%a2%bc%e5%ae%89%e5%85%a8%e5%bb%ba%e8%ad%b0-KHJcpXzHUB\">6. \u5bc6\u78bc\u5b89\u5168\u5efa\u8b70<\/h2>\n<ul>\n<li>\u4f7f\u7528\u5f37\u5bc6\u78bc\uff1a\u78ba\u4fdd\u5bc6\u78bc\u5305\u542b\u5b57\u6bcd\u3001\u6578\u5b57\u548c\u7279\u6b8a\u5b57\u7b26\uff0c\u4e26\u4e14\u9577\u5ea6\u81f3\u5c11\u70ba8\u500b\u5b57\u7b26\u3002<\/li>\n<li>\u5b9a\u671f\u66f4\u6539\u5bc6\u78bc\uff1a\u5efa\u8b70\u6bcf\u9694\u5e7e\u500b\u6708\u66f4\u6539\u4e00\u6b21\u5bc6\u78bc\uff0c\u4ee5\u63d0\u9ad8\u5b89\u5168\u6027\u3002<\/li>\n<li>\u9650\u5236\u7528\u6236\u6b0a\u9650\uff1a\u6839\u64da\u9700\u8981\u70ba\u7528\u6236\u5206\u914d\u6700\u5c0f\u6b0a\u9650\uff0c\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u6578\u64da\u8a2a\u554f\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-KHJcpXzHUB\">\u7e3d\u7d50<\/h2>\n<p>\u5728CentOS 6.9\u4e0a\u8a2d\u7f6e\u548c\u66f4\u6539\u6578\u64da\u5eab\u5bc6\u78bc\u662f\u4e00\u500b\u7c21\u55ae\u4f46\u91cd\u8981\u7684\u904e\u7a0b\u3002\u901a\u904e\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u5b89\u5168\u6027\uff0c\u4fdd\u8b77\u60a8\u7684\u6578\u64da\u4e0d\u53d7\u672a\u7d93\u6388\u6b0a\u7684\u8a2a\u554f\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u591a\u6709\u95dc\u4f3a\u670d\u5668\u7ba1\u7406\u7684\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\uff0c\u4e86\u89e3\u66f4\u591a\u6709\u95dc<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u548c\u5176\u4ed6\u670d\u52d9\u7684\u8a73\u7d30\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728CentOS 6.9\u4e2d\u8a2d\u7f6e\u548c\u66f4\u6539\u6578\u64da\u5eab\u5bc6\u78bc\uff0c\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u548c\u7cfb\u7d71\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-59557","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59557","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"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=59557"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59557\/revisions"}],"predecessor-version":[{"id":59558,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/59557\/revisions\/59558"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=59557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=59557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=59557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}