{"id":6672,"date":"2024-11-14T12:06:50","date_gmt":"2024-11-14T04:06:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6672\/"},"modified":"2024-11-14T12:06:50","modified_gmt":"2024-11-14T04:06:50","slug":"mysql%e6%ba%90%e7%a0%81%e5%8c%85centos7%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6672\/","title":{"rendered":"mysql\u6e90\u7801\u5305centos7\u5b89\u88c5\u6559\u7a0b"},"content":{"rendered":"<blockquote><p>\n  \u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u5728 centos 7 \u7cfb\u7edf\u4e0a\u5b89\u88c5 mysql \u6e90\u7801\u5305\u7684\u8be6\u7ec6\u6559\u7a0b\u3002mysql \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (rdbms)\uff0c\u5e7f\u6cdb\u7528\u4e8e\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u548c\u7f51\u7ad9\u4e2d\u3002\u901a\u8fc7\u5b89\u88c5 mysql \u6e90\u7801\u5305\uff0c\u60a8\u53ef\u4ee5\u83b7\u5f97 mysql \u7684\u6700\u65b0\u7248\u672c\u5e76\u6839\u636e\u81ea\u5df1\u7684\u7279\u5b9a\u9700\u6c42\u8fdb\u884c\u81ea\u5b9a\u4e49\u914d\u7f6e\u3002\u672c\u6559\u7a0b\u5c06\u4ece\u4e0b\u8f7d\u6e90\u4ee3\u7801\u5e76\u7f16\u8bd1\u5b89\u88c5\u5f00\u59cb\uff0c\u7136\u540e\u4ecb\u7ecd\u5982\u4f55\u914d\u7f6e\u548c\u542f\u52a8 mysql \u670d\u52a1\uff0c\u6700\u540e\u63d0\u4f9b\u4e00\u4e9b\u6709\u7528\u7684\u8d44\u6e90\u548c\u6545\u969c\u6392\u9664\u63d0\u793a\u3002\u65e0\u8bba\u60a8\u662f\u6570\u636e\u5e93\u7ba1\u7406\u5458\u3001\u5f00\u53d1\u4eba\u5458\u8fd8\u662f\u60f3\u8981\u6df1\u5165\u4e86\u89e3 mysql \u5185\u90e8\u5de5\u4f5c\u7684\u6280\u672f\u4eba\u5458\uff0c\u672c\u6559\u7a0b\u90fd\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u5b89\u88c5 mysql \u6e90\u7801\u5305\u5e76\u5728 centos 7 \u7cfb\u7edf\u4e0a\u6210\u529f\u8fd0\u884c mysql \u7684\u6574\u4e2a\u8fc7\u7a0b\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202410\/17\/2024101714160070233.jpg\" class=\"aligncenter\" title=\"mysql\u6e90\u7801\u5305centos7\u5b89\u88c5\u6559\u7a0b\u63d2\u56fe\" alt=\"mysql\u6e90\u7801\u5305centos7\u5b89\u88c5\u6559\u7a0b\u63d2\u56fe\" \/><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>CentOS 7 \u4e0a\u7684 MySQL \u6e90\u7801\u5305\u5b89\u88c5\u6559\u7a0b<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">MySQL \u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (RDBMS)\u3002\u672c\u6587\u63d0\u4f9b\u4e86\u5728 CentOS 7 \u7cfb\u7edf\u4e0a\u5b89\u88c5 MySQL \u6e90\u7801\u5305\u7684\u5206\u6b65\u8bf4\u660e\u3002<\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u5148\u51b3\u6761\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u5df2\u5b89\u88c5\u7684 CentOS 7  <\/li>\n<li>root \u7528\u6237\u6743\u9650\u6216\u5177\u6709 sudo \u6743\u9650\u7684\u7528\u6237<\/li>\n<li>Internet \u8bbf\u95ee\u6743\u9650<\/li>\n<\/ul>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>1. \u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879<\/strong><\/p>\n<pre>sudo&nbsp;yum&nbsp;install&nbsp;gcc&nbsp;gcc-c++&nbsp;cmake&nbsp;ncurses-devel&nbsp;openssl-devel<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>2. \u4e0b\u8f7d MySQL \u6e90\u7801\u5305<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u4ece MySQL \u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d MySQL \u6e90\u7801\u5305\u3002\u672c\u6587\u5c06\u4f7f\u7528 MySQL 8.0.29 \u7248\u672c\uff1a<\/p>\n<pre>wget&nbsp;https:\/\/cdn.mysql.com\/archives\/mysql-8.0\/mysql-8.0.29.tar.gz<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>3. \u89e3\u538b\u6e90\u7801\u5305<\/strong><\/p>\n<pre>tar&nbsp;-xzvf&nbsp;mysql-8.0.29.tar.gz<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>4. \u7f16\u8bd1 MySQL<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u8fdb\u5165\u89e3\u538b\u540e\u7684\u6e90\u7801\u76ee\u5f55\u5e76\u8fd0\u884c cmake \u8fdb\u884c\u914d\u7f6e\uff1a<\/p>\n<pre>cd&nbsp;mysql-8.0.29\ncmake&nbsp;.<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u7136\u540e\uff0c\u6784\u5efa\u5e76\u5b89\u88c5 MySQL\uff1a<\/p>\n<pre>make&nbsp;-j$(nproc)\nsudo&nbsp;make&nbsp;install<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>5. \u521b\u5efa MySQL \u7528\u6237\u548c\u7ec4<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u521b\u5efa\u7528\u4e8e\u8fd0\u884c MySQL \u7684\u7528\u6237\u548c\u7ec4\uff1a<\/p>\n<pre>sudo&nbsp;groupadd&nbsp;mysql\nsudo&nbsp;useradd&nbsp;-r&nbsp;-g&nbsp;mysql&nbsp;-s&nbsp;\/bin\/false&nbsp;mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>6. \u521d\u59cb\u5316 MySQL \u6570\u636e\u76ee\u5f55<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u521d\u59cb\u5316 MySQL \u6570\u636e\u76ee\u5f55\uff0c\u8be5\u76ee\u5f55\u5c06\u5b58\u50a8\u6570\u636e\u5e93\u6587\u4ef6\uff1a<\/p>\n<pre>sudo&nbsp;mysql_install_db&nbsp;--user=mysql<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>7. \u542f\u52a8 MySQL<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u542f\u52a8 MySQL \u670d\u52a1\u5668\uff1a<\/p>\n<pre>sudo&nbsp;systemctl&nbsp;start&nbsp;mysqld<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>8. \u8bbe\u7f6e root \u5bc6\u7801<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fde\u63a5\u5230 MySQL \u5e76\u8bbe\u7f6e root \u7528\u6237\u7684\u5bc6\u7801\uff1a<\/p>\n<pre>sudo&nbsp;mysql&nbsp;-u&nbsp;root\nALTER&nbsp;USER&nbsp;'root'@'localhost'&nbsp;IDENTIFIED&nbsp;BY&nbsp;'your_password';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\"><strong>9. \u7ed3\u675f<\/strong><\/p>\n<p style=\"margin-top: 0px;margin-bottom: 9px;font-family:\">\u73b0\u5728\uff0cMySQL \u5df2\u6210\u529f\u5728\u60a8\u7684 CentOS 7 \u7cfb\u7edf\u4e0a\u5b89\u88c5\u5e76\u8fd0\u884c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6e90\u7801\u53057\u5b89\u88c5\u6559\u7a0b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u5728 centos 7 \u7cfb\u7edf\u4e0a\u5b89\u88c5 mysql \u6e90\u7801\u5305\u7684\u8be6\u7ec6\u6559\u7a0b\u3002mysql \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (rdbms)\uff0c\u5e7f\u6cdb\u7528\u4e8e\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u548c\u7f51\u7ad9\u4e2d\u3002\u901a\u8fc7\u5b89\u88c5 mysql \u6e90\u7801\u5305\uff0c\u60a8\u53ef\u4ee5\u83b7\u5f97 mysql \u7684\u6700\u65b0\u7248\u672c\u5e76\u6839\u636e\u81ea\u5df1\u7684\u7279\u5b9a\u9700\u6c42\u8fdb\u884c\u81ea\u5b9a\u4e49\u914d\u7f6e\u3002\u672c\u6559\u7a0b\u5c06\u4ece\u4e0b\u8f7d\u6e90\u4ee3\u7801\u5e76\u7f16\u8bd1\u5b89\u88c5\u5f00\u59cb\uff0c\u7136\u540e\u4ecb\u7ecd\u5982\u4f55\u914d\u7f6e\u548c\u542f\u52a8 mysql \u670d\u52a1\uff0c\u6700\u540e\u63d0\u4f9b\u4e00\u4e9b\u6709\u7528\u7684\u8d44\u6e90\u548c\u6545\u969c\u6392\u9664\u63d0\u793a\u3002\u65e0\u8bba\u60a8\u662f\u6570\u636e\u5e93\u7ba1\u7406\u5458\u3001\u5f00\u53d1\u4eba\u5458\u8fd8\u662f\u60f3\u8981\u6df1\u5165\u4e86\u89e3 mysql \u5185\u90e8\u5de5\u4f5c\u7684\u6280\u672f\u4eba\u5458\uff0c\u672c\u6559\u7a0b\u90fd\u5c06\u6307\u5bfc\u60a8\u5b8c\u6210\u5b89\u88c5 mysql \u6e90\u7801\u5305\u5e76\u5728 centos 7 \u7cfb\u7edf\u4e0a\u6210\u529f\u8fd0\u884c mysql \u7684\u6574\u4e2a\u8fc7\u7a0b\u3002 CentOS 7 \u4e0a\u7684 MySQL \u6e90\u7801\u5305\u5b89\u88c5\u6559\u7a0b MySQL \u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf (RDBMS)\u3002\u672c\u6587\u63d0\u4f9b\u4e86\u5728 CentOS 7 \u7cfb\u7edf\u4e0a\u5b89\u88c5 MySQL \u6e90\u7801\u5305\u7684\u5206\u6b65\u8bf4\u660e\u3002 \u5148\u51b3\u6761\u4ef6\uff1a \u5df2\u5b89\u88c5\u7684 CentOS 7 root \u7528\u6237\u6743\u9650\u6216\u5177\u6709 sudo \u6743\u9650\u7684\u7528\u6237 Internet \u8bbf\u95ee\u6743\u9650 \u6b65\u9aa4\uff1a 1. \u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u9879 sudo&nbsp;yum&nbsp;install&nbsp;gcc&nbsp;gcc-c++&nbsp;cmake&nbsp;ncurses-devel&nbsp;openssl-devel \u767b\u5f55\u540e\u590d\u5236 2. \u4e0b\u8f7d MySQL \u6e90\u7801\u5305 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6672","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6672"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6672\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}