{"id":60743,"date":"2026-01-16T09:41:35","date_gmt":"2026-01-16T01:41:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/60743.html"},"modified":"2026-01-16T09:41:35","modified_gmt":"2026-01-16T01:41:35","slug":"cemysql%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/60743.html","title":{"rendered":"CE(MySql\u670d\u52a1)"},"content":{"rendered":"<h3>1 \u4ec0\u4e48\u662f\u6570\u636e\u5e93<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"561\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974d341da.png\" width=\"894\" \/><\/p>\n<h4>1.1 \u6570\u636e<\/h4>\n<p>\u6570\u636e\u662f\u63cf\u8ff0\u4e8b\u7269\u7684\u7b26\u53f7\u8bb0\u5f55&#xff0c;\u5176\u8868\u73b0\u5f62\u5f0f\u591a\u6837&#xff0c;\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6570\u5b57\u3001\u6587\u5b57\u3001\u56fe\u5f62\u3001\u56fe\u50cf\u3001\u58f0\u97f3\u3001\u8bed\u8a00\u7b49\u3002\u65e0\u8bba\u54ea\u79cd\u5f62\u5f0f&#xff0c;\u90fd\u53ef\u901a\u8fc7\u6570\u5b57\u5316\u5904\u7406\u540e\u5b58\u50a8\u5230\u8ba1\u7b97\u673a\u4e2d&#xff0c;\u662f\u6570\u636e\u5e93\u5b58\u50a8\u7684\u6838\u5fc3\u5bf9\u8c61\u3002<\/p>\n<h4>1.2 \u6570\u636e\u5e93<\/h4>\n<p>\u6570\u636e\u5e93&#xff08;Database&#xff0c;DB&#xff09;\u662f\u957f\u671f\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u5185\u3001\u6709\u7ec4\u7ec7\u3001\u53ef\u5171\u4eab\u7684\u5927\u91cf\u6570\u636e\u7684\u96c6\u5408\u3002\u5176\u6838\u5fc3\u7279\u5f81\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u7279\u5f81\u8be6\u7ec6\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u636e\u7ed3\u6784\u5316<\/td>\n<td>\u6570\u636e\u6309\u7167\u7edf\u4e00\u7684\u903b\u8f91\u7ed3\u6784&#xff08;\u5982\u5173\u7cfb\u6a21\u578b\u7684\u8868\u7ed3\u6784&#xff09;\u7ec4\u7ec7&#xff0c;\u4e0d\u540c\u6570\u636e\u4e4b\u95f4\u5b58\u5728\u660e\u786e\u5173\u8054&#xff0c;\u800c\u975e\u6742\u4e71\u65e0\u7ae0\u7684\u5806\u79ef<\/td>\n<\/tr>\n<tr>\n<td>\u5171\u4eab\u6027\u9ad8\u3001\u5197\u4f59\u5ea6\u4f4e\u3001\u6613\u6269\u5145<\/td>\n<td>\u591a\u4e2a\u7528\u6237 \/ \u5e94\u7528\u53ef\u540c\u65f6\u8bbf\u95ee\u6570\u636e\u5e93&#xff1b;\u6570\u636e\u91cd\u590d\u5b58\u50a8\u7684\u6bd4\u4f8b\u6781\u4f4e&#xff0c;\u8282\u7701\u5b58\u50a8\u7a7a\u95f4&#xff1b;\u65b0\u589e \/ \u4fee\u6539\u6570\u636e\u7ed3\u6784\u65f6&#xff0c;\u5bf9\u73b0\u6709\u5e94\u7528\u5f71\u54cd\u5c0f&#xff0c;\u6613\u4e8e\u6269\u5c55<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u72ec\u7acb\u6027\u9ad8<\/td>\n<td>\u5206\u4e3a\u7269\u7406\u72ec\u7acb\u6027&#xff08;\u6570\u636e\u5b58\u50a8\u4f4d\u7f6e \/ \u65b9\u5f0f\u6539\u53d8&#xff0c;\u4e0d\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f&#xff09;\u548c\u903b\u8f91\u72ec\u7acb\u6027&#xff08;\u6570\u636e\u903b\u8f91\u7ed3\u6784\u6539\u53d8&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u65e0\u9700\u4fee\u6539&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u7edf\u4e00\u7ba1\u7406\u4e0e\u63a7\u5236<\/td>\n<td>\u7531\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf&#xff08;DBMS&#xff09;\u8d1f\u8d23&#xff0c;\u6838\u5fc3\u7ba1\u63a7\u80fd\u529b\u5305\u62ec&#xff1a;1. \u5b89\u5168\u6027&#xff1a;\u9632\u6b62\u672a\u6388\u6743\u8bbf\u95ee \/ \u7be1\u6539\u6570\u636e2. \u5b8c\u6574\u6027&#xff1a;\u4fdd\u8bc1\u6570\u636e\u7684\u51c6\u786e\u6027\u3001\u4e00\u81f4\u6027&#xff08;\u5982\u5b57\u6bb5\u975e\u7a7a\u3001\u552f\u4e00\u7ea6\u675f&#xff09;3. \u5e76\u53d1\u63a7\u5236&#xff1a;\u89e3\u51b3\u591a\u7528\u6237\u540c\u65f6\u64cd\u4f5c\u6570\u636e\u7684\u51b2\u7a81\u95ee\u98984. \u6545\u969c\u6062\u590d&#xff1a;\u6570\u636e\u5f02\u5e38\u65f6&#xff08;\u5982\u65ad\u7535&#xff09;\u53ef\u6062\u590d\u5230\u6b63\u5e38\u72b6\u6001<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2 MySQL \u6982\u8ff0<\/h3>\n<h4>2.1 \u53d1\u5c55\u5386\u7a0b<\/h4>\n<ul>\n<li>\u6700\u521d\u7531\u745e\u5178 MySQL AB \u516c\u53f8\u5f00\u53d1&#xff0c;\u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf&#xff08;RDBMS&#xff09;&#xff1b;<\/li>\n<li>2008 \u5e74 1 \u6708&#xff0c;Sun \u516c\u53f8\u4ee5 10 \u4ebf\u7f8e\u91d1\u6536\u8d2d MySQL AB&#xff1b;<\/li>\n<li>2009 \u5e74&#xff0c;Oracle \u516c\u53f8\u4ee5 74 \u4ebf\u7f8e\u91d1\u6536\u8d2d Sun \u516c\u53f8&#xff0c;MySQL \u6b63\u5f0f\u5f52\u5165 Oracle \u65d7\u4e0b\u3002<\/li>\n<\/ul>\n<h4>2.2 \u6838\u5fc3\u4f18\u52bf\u4e0e\u5e94\u7528\u573a\u666f<\/h4>\n<ul>\n<li>\u4f18\u52bf&#xff1a;\u4f53\u79ef\u5c0f\u5de7\u3001\u8fd0\u884c\u901f\u5ea6\u5feb\u3001\u90e8\u7f72 \/ \u4f7f\u7528\u6210\u672c\u4f4e\u3001\u5b8c\u5168\u5f00\u6e90&#xff08;\u793e\u533a\u7248&#xff09;\u3001\u8de8\u5e73\u53f0&#xff08;\u652f\u6301 Linux\/Windows\/Mac \u7b49&#xff09;&#xff1b;<\/li>\n<li>\u5e94\u7528\u573a\u666f&#xff1a;\u5e7f\u6cdb\u7528\u4e8e Internet \u4e2d\u5c0f\u578b\u7f51\u7ad9\u3001\u8f7b\u91cf\u7ea7\u4f01\u4e1a\u5e94\u7528\u3001\u4e2a\u4eba\u5f00\u53d1\u9879\u76ee&#xff0c;\u662f LAMP&#xff08;Linux&#043;Apache&#043;MySQL&#043;PHP&#xff09;\/LNMP&#xff08;Linux&#043;Nginx&#043;MySQL&#043;PHP&#xff09;\u67b6\u6784\u7684\u6838\u5fc3\u7ec4\u4ef6\u3002<\/li>\n<\/ul>\n<h3>3 \u7248\u672c\u53ca\u4e0b\u8f7d<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"760\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974d6ba05.png\" width=\"860\" \/><\/p>\n<h4>3.1 \u7248\u672c\u5206\u7c7b<\/h4>\n<p>MySQL \u4e3b\u8981\u5206\u4e3a\u793e\u533a\u7248&#xff08;MySQL Community Server&#xff09;\u548c\u5546\u4e1a\u7248&#xff08;MySQL Enterprise Edition&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u793e\u533a\u7248&#xff1a;\u514d\u8d39\u5f00\u6e90&#xff0c;\u6ee1\u8db3\u7edd\u5927\u90e8\u5206\u4e2d\u5c0f\u578b\u5e94\u7528\u9700\u6c42&#xff1b;<\/li>\n<li>\u5546\u4e1a\u7248&#xff1a;\u6536\u8d39&#xff0c;\u63d0\u4f9b\u5b98\u65b9\u6280\u672f\u652f\u6301\u3001\u9ad8\u7ea7\u529f\u80fd&#xff08;\u5982\u4f01\u4e1a\u7ea7\u76d1\u63a7\u3001\u5b89\u5168\u52a0\u56fa&#xff09;\u3002<\/li>\n<\/ul>\n<h4>3.2 \u4e0b\u8f7d\u5730\u5740\u4e0e\u6559\u7a0b<\/h4>\n<ul>\n<li>\u5b98\u65b9\u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/dev.mysql.com\/downloads\/mysql\/&#xff08;\u53ef\u9009\u62e9\u5bf9\u5e94\u7cfb\u7edf \/ \u7248\u672c&#xff09;&#xff1b;<\/li>\n<li>\u7248\u672c\u5b89\u88c5\u6559\u7a0b&#xff08;\u4ee5 5.7 \u4e3a\u4f8b&#xff09;&#xff1a;https:\/\/dev.mysql.com\/doc\/refman\/5.7\/en\/installing.html&#xff1b;<\/li>\n<li>\u6ce8\u610f&#xff1a;\u4e0b\u8f7d\u65f6\u9700\u5339\u914d\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c&#xff08;\u5982 CentOS 8\/EulerOS 22 \u5bf9\u5e94 RedHat 8 \u7cfb\u5217&#xff09;\u3001CPU \u67b6\u6784&#xff08;x86_64\/arm64 \u7b49&#xff09;\u3002<\/li>\n<\/ul>\n<h3>4 Yum \u4ed3\u5e93\u5b89\u88c5&#xff08;CentOS\/RHEL\/EulerOS&#xff09;<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"467\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974daea4b.png\" width=\"855\" \/><\/p>\n<h4>4.1 \u6dfb\u52a0 Yum \u6e90<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"545\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974dd41b1.png\" width=\"895\" \/><\/p>\n<h5>\u6b65\u9aa4 1&#xff1a;\u8bbf\u95ee\u5b98\u65b9\u6e90\u9875\u9762<\/h5>\n<li>\u6253\u5f00 MySQL \u5b98\u7f51&#xff1a;https:\/\/www.mysql.com\/&#xff1b;<\/li>\n<li>\u8fdb\u5165\u4e0b\u8f7d\u6307\u5f15\u9875&#xff1a;https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/linux-installation-yum-repo.html&#xff1b;<\/li>\n<li>\u70b9\u51fb\u300cMySQL Community (GPL) Downloads \u00bb\u300d&#xff1a;https:\/\/dev.mysql.com\/downloads\/&#xff1b;<\/li>\n<li>\u9009\u62e9\u300cMySQL Yum Repository\u300d&#xff1a;https:\/\/dev.mysql.com\/downloads\/repo\/yum\/&#xff1b;<\/li>\n<li>\u6839\u636e\u7cfb\u7edf\u7248\u672c\u9009\u62e9 Yum \u6e90\u5305&#xff08;\u5173\u952e&#xff1a;Euler22&#061;CentOS8&#061;RedHat8&#xff09;\u3002<\/li>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"323\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014134-6969974e0717e.png\" width=\"868\" \/><\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u4e0b\u8f7d\u5e76\u5b89\u88c5 Yum \u6e90<\/h5>\n<p># \u4e0b\u8f7dMySQL 8.0 Yum\u6e90\u5305&#xff08;\u4ee5el8\u7248\u672c\u4e3a\u4f8b&#xff09;<br \/>\n[root&#064;server ~]# wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el8-9.noarch.rpm  <\/p>\n<p># \u5b89\u88c5Yum\u6e90\u5305&#xff08;\u5b89\u88c5\u540e\u4f1a\u5728\/etc\/yum.repos.d\/\u751f\u6210mysql\u76f8\u5173repo\u6587\u4ef6&#xff09;<br \/>\n[root&#064;server ~]# rpm -ivh mysql80-community-release-el8-9.noarch.rpm  <\/p>\n<p># \u9a8c\u8bc1Yum\u6e90\u662f\u5426\u751f\u6548&#xff08;\u5217\u51fa\u6240\u6709mysql\u76f8\u5173\u5305&#xff09;<br \/>\n[root&#064;server ~]# yum list | grep mysql<\/p>\n<h4>4.2 \u5b89\u88c5 MySQL \u670d\u52a1<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u5b89\u88c5\u6838\u5fc3\u5305<\/h5>\n<p># \u5b89\u88c5MySQL\u793e\u533a\u7248\u670d\u52a1\u7aef&#xff08;\u81ea\u52a8\u4f9d\u8d56\u5b89\u88c5\u5ba2\u6237\u7aef\u3001\u516c\u5171\u5e93\u7b49&#xff09;<br \/>\n[root&#064;server ~]# yum install mysql-community-server.x86_64 -y<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u542f\u52a8\u5e76\u68c0\u67e5\u670d\u52a1\u72b6\u6001<\/h5>\n<p># \u542f\u52a8mysqld\u670d\u52a1&#xff08;\u6ce8\u610f\u670d\u52a1\u540d\u5e26d&#xff0c;\u4ee3\u8868daemon\u5b88\u62a4\u8fdb\u7a0b&#xff09;<br \/>\n[root&#064;server ~]# systemctl start mysqld  <\/p>\n<p># \u67e5\u770b\u670d\u52a1\u72b6\u6001&#xff08;active (running) \u8868\u793a\u542f\u52a8\u6210\u529f&#xff09;<br \/>\n[root&#064;server ~]# systemctl status mysqld  <\/p>\n<p># \u53ef\u9009&#xff1a;\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\n[root&#064;server ~]# systemctl enable mysqld<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u83b7\u53d6\u521d\u59cb\u4e34\u65f6\u5bc6\u7801<\/h5>\n<p>MySQL \u9996\u6b21\u542f\u52a8\u4f1a\u81ea\u52a8\u4e3a root&#064;localhost\u751f\u6210\u4e34\u65f6\u5bc6\u7801&#xff0c;\u5b58\u50a8\u5728\u65e5\u5fd7\u6587\u4ef6\u4e2d&#xff1a;<\/p>\n<p>[root&#064;server ~]# grep &#039;temporary password&#039; \/var\/log\/mysqld.log<br \/>\n# \u793a\u4f8b\u8f93\u51fa&#xff1a;2023-07-09T02:38:36.368700Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root&#064;localhost: qQ6OmpD?8_.f<br \/>\n# \u4e0a\u8ff0\u8f93\u51fa\u4e2d\u300cqQ6OmpD?8_.f\u300d\u5373\u4e3a\u521d\u59cb\u5bc6\u7801&#xff0c;\u9700\u590d\u5236\u4fdd\u5b58<\/p>\n<h5>\u6b65\u9aa4 4&#xff1a;\u767b\u5f55\u5e76\u4fee\u6539\u5bc6\u7801<\/h5>\n<p># \u4ee5root\u8eab\u4efd\u767b\u5f55MySQL&#xff08;\u8f93\u5165\u4e34\u65f6\u5bc6\u7801&#xff09;<br \/>\n[root&#064;server ~]# mysql -u root -p<br \/>\nEnter password:  # \u7c98\u8d34\u4e0a\u8ff0\u4e34\u65f6\u5bc6\u7801<\/p>\n<p># \u4fee\u6539root\u5bc6\u7801&#xff08;\u9700\u7b26\u5408\u9ed8\u8ba4\u5bc6\u7801\u89c4\u5219&#xff09;<br \/>\nmysql&gt; alter user &#039;root&#039;&#064;&#039;localhost&#039; identified by &#039;Admin123!&#039;; <\/p>\n<h5>\u6b65\u9aa4 5&#xff1a;\u5bc6\u7801\u89c4\u5219\u8be6\u89e3\u4e0e\u8c03\u6574<\/h5>\n<h6>\u67e5\u770b\u9ed8\u8ba4\u5bc6\u7801\u89c4\u5219<\/h6>\n<p>mysql&gt; show variables like &#039;validate_password.%&#039;;<br \/>\n# \u8f93\u51fa\u89e3\u6790&#xff1a;<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8211;&#043;<br \/>\n# | Variable_name                        | Value  |<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8211;&#043;<br \/>\n# | validate_password.check_user_name    | ON     | # \u7981\u6b62\u5bc6\u7801\u4e0e\u7528\u6237\u540d\u76f8\u540c<br \/>\n# | validate_password.dictionary_file    |        | # \u5bc6\u7801\u5b57\u5178\u6587\u4ef6&#xff08;\u7a7a\u5219\u4e0d\u6821\u9a8c&#xff09;<br \/>\n# | validate_password.length             | 8      | # \u5bc6\u7801\u6700\u5c0f\u957f\u5ea6<br \/>\n# | validate_password.mixed_case_count   | 1      | # \u81f3\u5c111\u4e2a\u5927\u5c0f\u5199\u5b57\u6bcd<br \/>\n# | validate_password.number_count       | 1      | # \u81f3\u5c111\u4e2a\u6570\u5b57<br \/>\n# | validate_password.policy             | MEDIUM | # \u9a8c\u8bc1\u7b56\u7565&#xff08;LOW\/MEDIUM\/STRONG&#xff09;<br \/>\n# | validate_password.special_char_count | 1      | # \u81f3\u5c111\u4e2a\u7279\u6b8a\u5b57\u7b26<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;&#8212;&#8212;&#8211;&#043;<\/p>\n<h6>\u8c03\u6574\u5bc6\u7801\u89c4\u5219&#xff08;\u6d4b\u8bd5\u73af\u5883\u53ef\u9009&#xff0c;\u751f\u4ea7\u4e0d\u63a8\u8350&#xff09;<\/h6>\n<p># \u964d\u4f4e\u9a8c\u8bc1\u7b56\u7565\u4e3aLOW&#xff08;\u4ec5\u6821\u9a8c\u957f\u5ea6&#xff09;<br \/>\nmysql&gt; set global validate_password.policy&#061;low;  <\/p>\n<p># \u7f29\u77ed\u5bc6\u7801\u6700\u5c0f\u957f\u5ea6\u4e3a6\u4f4d<br \/>\nmysql&gt; set global validate_password.length&#061;6;  <\/p>\n<p># \u8bbe\u7f6e\u7b80\u5355\u5bc6\u7801&#xff08;\u5982123456&#xff09;<br \/>\nmysql&gt; alter user &#039;root&#039;&#064;&#039;localhost&#039; identified by &#039;123456&#039;;  <\/p>\n<p># \u9000\u51faMySQL<br \/>\nmysql&gt; exit<br \/>\nBye<\/p>\n<h5>\u6b65\u9aa4 6&#xff1a;\u9a8c\u8bc1\u767b\u5f55\u4e0e\u57fa\u7840\u64cd\u4f5c<\/h5>\n<p># \u91cd\u65b0\u767b\u5f55&#xff08;\u8f93\u5165\u65b0\u5bc6\u7801123456&#xff09;<br \/>\n[root&#064;server ~]# mysql -u root -p<br \/>\nEnter password: 123456<\/p>\n<p># \u67e5\u770b\u6240\u6709\u6570\u636e\u5e93&#xff08;\u6ce8\u610f\u7ed3\u5c3e\u5206\u53f7&#xff0c;s\u4e0d\u53ef\u7701\u7565&#xff09;<br \/>\nmysql&gt; show databases;<br \/>\n# \u793a\u4f8b\u8f93\u51fa&#xff1a;<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n# | Database           |<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n# | information_schema | # \u5143\u6570\u636e\u4fe1\u606f\u5e93<br \/>\n# | mysql              | # \u7cfb\u7edf\u6838\u5fc3\u5e93&#xff08;\u5b58\u50a8\u7528\u6237\u3001\u6743\u9650\u7b49&#xff09;<br \/>\n# | performance_schema | # \u6027\u80fd\u76d1\u63a7\u5e93<br \/>\n# | sys                | # \u7b80\u5316\u6027\u80fd\u76d1\u63a7\u7684\u89c6\u56fe\u5e93<br \/>\n# &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<\/p>\n<p># \u67e5\u770bMySQL\u9ed8\u8ba4\u7aef\u53e3&#xff08;\u9ed8\u8ba43306&#xff09;<br \/>\nmysql&gt; show global variables like &#039;port&#039;;  <\/p>\n<p># \u9000\u51faMySQL<br \/>\nmysql&gt; quit<br \/>\nBye<\/p>\n<h3>5 \u672c\u5730 RPM \u5305\u5b89\u88c5&#xff08;\u65e0\u7f51\u7edc\u73af\u5883\u9002\u7528&#xff09;<\/h3>\n<h4>5.1 \u4e0b\u8f7d RPM \u96c6\u5408\u5305<\/h4>\n<li>\u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/downloads.mysql.com\/archives\/community\/&#xff1b;<\/li>\n<li>\u9009\u62e9\u5bf9\u5e94\u7248\u672c&#xff08;\u5982 8.0.32&#xff09;\u3001\u7cfb\u7edf&#xff08;el9&#xff09;\u3001\u67b6\u6784&#xff08;x86_64&#xff09;\u7684\u300cRPM Bundle\u300d\u96c6\u5408\u5305&#xff1b;<\/li>\n<li>\u63a8\u8350\u4f7f\u7528\u8fc5\u96f7\u7b49\u5de5\u5177\u4e0b\u8f7d&#xff08;\u901f\u5ea6\u66f4\u5feb&#xff09;\u3002<\/li>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"244\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014134-6969974e24b3d.png\" width=\"862\" \/><\/p>\n<h4>5.2 \u4e0a\u4f20\u5b89\u88c5\u5305<\/h4>\n<p>\u4f7f\u7528 XFTP\/SCP \u7b49\u5de5\u5177\u5c06\u4e0b\u8f7d\u7684 RPM \u96c6\u5408\u5305\u4e0a\u4f20\u5230 Linux \u670d\u52a1\u5668&#xff08;\u5982 \/root \u76ee\u5f55&#xff09;\u3002<\/p>\n<h4>5.3 \u5b89\u88c5\u6b65\u9aa4<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u89e3\u538b RPM \u96c6\u5408\u5305<\/h5>\n<p># \u5207\u6362\u5230\u6839\u76ee\u5f55&#xff08;\u6216\u4e0a\u4f20\u5305\u6240\u5728\u76ee\u5f55&#xff09;<br \/>\n[root&#064;server ~]# cd \/  <\/p>\n<p># \u89e3\u538b\u96c6\u5408\u5305&#xff08;\u751f\u6210\u591a\u4e2a\u5355\u72ec\u7684RPM\u5305&#xff09;<br \/>\n[root&#064;server \/]# tar -xvf mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar  <\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u5b89\u88c5\u6838\u5fc3 RPM<\/h5>\n<p># \u672c\u5730\u5b89\u88c5&#xff08;&#8211;nogpgcheck\u53ef\u9009&#xff0c;\u8df3\u8fc7GPG\u6821\u9a8c&#xff09;<br \/>\n[root&#064;server \/]# yum localinstall -y \\\\<br \/>\nmysql-community-server-8.0.32-1.el9.x86_64.rpm \\\\  # \u670d\u52a1\u7aef&#xff08;\u5fc5\u88c5&#xff09;<br \/>\nmysql-community-client-8.0.32-1.el9.x86_64.rpm \\\\  # \u5ba2\u6237\u7aef&#xff08;\u5fc5\u88c5&#xff09;<br \/>\nmysql-community-common-8.0.32-1.el9.x86_64.rpm \\\\  # \u516c\u5171\u5e93&#xff08;\u5fc5\u88c5&#xff09;<br \/>\nmysql-community-icu-data-files-8.0.32-1.el9.x86_64.rpm \\\\  # ICU\u6570\u636e\u6587\u4ef6&#xff08;\u5fc5\u88c5&#xff09;<br \/>\nmysql-community-client-plugins-8.0.32-1.el9.x86_64.rpm \\\\  # \u5ba2\u6237\u7aef\u63d2\u4ef6&#xff08;\u5fc5\u88c5&#xff09;<br \/>\nmysql-community-libs-8.0.32-1.el9.x86_64.rpm  # \u5f00\u53d1\u5e93&#xff08;\u53ef\u9009&#xff0c;C\/C&#043;&#043;\u5f00\u53d1\u7528&#xff09;<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u542f\u52a8\u670d\u52a1\u5e76\u83b7\u53d6\u4e34\u65f6\u5bc6\u7801<\/h5>\n<p># \u542f\u52a8\u670d\u52a1<br \/>\n[root&#064;server \/]# systemctl start mysqld  <\/p>\n<p># \u67e5\u770b\u670d\u52a1\u72b6\u6001<br \/>\n[root&#064;server \/]# systemctl status mysqld  <\/p>\n<p># \u83b7\u53d6\u521d\u59cb\u4e34\u65f6\u5bc6\u7801<br \/>\n[root&#064;server \/]# grep password \/var\/log\/mysqld.log<br \/>\n# \u793a\u4f8b\u8f93\u51fa&#xff1a;2023-02-09T03:55:47.305118Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root&#064;localhost: q&amp;2PO.yJZ&#043;Hp<\/p>\n<h5>\u6b65\u9aa4 4&#xff1a;\u767b\u5f55\u5e76\u91cd\u7f6e\u5bc6\u7801<\/h5>\n<p># \u767b\u5f55MySQL&#xff08;\u8f93\u5165\u4e34\u65f6\u5bc6\u7801&#xff09;<br \/>\n[root&#064;server \/]# mysql -u root -p<br \/>\nEnter password: q&amp;2PO.yJZ&#043;Hp  <\/p>\n<p># \u9996\u6b21\u767b\u5f55\u6267\u884c\u4efb\u610f\u547d\u4ee4\u4f1a\u63d0\u793a\u91cd\u7f6e\u5bc6\u7801<br \/>\nmysql&gt; show databases;<br \/>\n# \u62a5\u9519&#xff1a;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.<\/p>\n<p># \u91cd\u7f6e\u5bc6\u7801&#xff08;\u7b26\u5408\u9ed8\u8ba4\u89c4\u5219&#xff09;<br \/>\nmysql&gt; alter user &#039;root&#039;&#064;&#039;localhost&#039; identified by &#039;MyNewPass1!&#039;;  <\/p>\n<p># \u9000\u51faMySQL<br \/>\nmysql&gt; exit<br \/>\nBye<\/p>\n<h3>6 \u901a\u7528\u4e8c\u8fdb\u5236\u5305\u5b89\u88c5&#xff08;\u751f\u4ea7\u73af\u5883\u9996\u9009&#xff09;<\/h3>\n<h4>6.1 \u4e8c\u8fdb\u5236\u5305\u4f18\u52bf<\/h4>\n<ul>\n<li>\u9884\u7f16\u8bd1\u5b8c\u6210&#xff0c;\u5b89\u88c5\u901f\u5ea6\u5feb&#xff1b;<\/li>\n<li>\u81ea\u5b9a\u4e49\u7a0b\u5ea6\u9ad8&#xff08;\u53ef\u6307\u5b9a\u5b89\u88c5\u76ee\u5f55\u3001\u6570\u636e\u76ee\u5f55&#xff09;&#xff1b;<\/li>\n<li>\u7a33\u5b9a\u6027\u597d&#xff0c;\u662f\u751f\u4ea7\u73af\u5883\u4e3b\u6d41\u5b89\u88c5\u65b9\u5f0f&#xff1b;<\/li>\n<li>\u4e8c\u8fdb\u5236\u5305&#xff1a;\u6e90\u7801\u5305\u7f16\u8bd1\u540e\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5305&#xff0c;\u65e0\u9700\u7f16\u8bd1\u5373\u53ef\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<h4>6.2 \u4e0b\u8f7d\u4e8c\u8fdb\u5236\u5305<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"667\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014134-6969974e40e05.png\" width=\"855\" \/><\/p>\n<li>\u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/dev.mysql.com\/downloads\/mysql\/&#xff1b;<\/li>\n<li>\u9009\u62e9\u4f9d\u636e&#xff1a;\n<ul>\n<li>\u7cfb\u7edf glibc \u7248\u672c&#xff08;\u5982 glibc2.17&#xff09;&#xff1b;<\/li>\n<li>CPU \u67b6\u6784&#xff08;x86_64\/arm64&#xff09;&#xff1b;<\/li>\n<li>\u7248\u672c&#xff08;\u5982 8.0.33&#xff09;&#xff1b;<\/li>\n<li>\u9009\u62e9\u300cLinux &#8211; Generic\u300d\u4e0b\u7684\u300cCompressed TAR Archive\u300d\u5305\u3002<\/li>\n<\/ul>\n<\/li>\n<h4>6.3 \u4e0a\u4f20\u8f6f\u4ef6\u5305<\/h4>\n<p>\u4f7f\u7528 XFTP \u5c06\u4e8c\u8fdb\u5236\u5305\u4e0a\u4f20\u5230 Linux \u670d\u52a1\u5668\u6839\u76ee\u5f55&#xff08;\/&#xff09;\u3002<\/p>\n<h4>6.4 \u89e3\u538b\u7f29<\/h4>\n<p># \u5207\u6362\u5230\u6839\u76ee\u5f55<br \/>\n[root&#064;server ~]# cd \/  <\/p>\n<p># \u89e3\u538b\u5916\u5c42tar\u5305&#xff08;\u751f\u6210xz\u538b\u7f29\u5305&#xff09;<br \/>\n[root&#064;server \/]# tar xvf mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar  <\/p>\n<p># \u89e3\u538b\u6838\u5fc3xz\u5305&#xff08;\u751f\u6210\u5b89\u88c5\u76ee\u5f55&#xff09;<br \/>\n[root&#064;server \/]# tar xvf mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar.xz  <\/p>\n<p># \u9a8c\u8bc1\u89e3\u538b\u7ed3\u679c&#xff08;\u67e5\u770b\u751f\u6210\u7684\u76ee\u5f55&#xff09;<br \/>\n[root&#064;server \/]# ls<br \/>\n# \u793a\u4f8b\u8f93\u51fa&#xff1a;mysql-8.0.33-linux-glibc2.17-x86_64-minimal<\/p>\n<h4>6.5 \u5b89\u88c5\u524d\u51c6\u5907&#xff08;\u6743\u9650 \/ \u76ee\u5f55\u914d\u7f6e&#xff09;<\/h4>\n<p># \u79fb\u52a8\u5b89\u88c5\u76ee\u5f55\u5230\/usr\/local&#xff08;\u901a\u7528\u5b89\u88c5\u8def\u5f84&#xff09;<br \/>\n[root&#064;server \/]# mv mysql-8.0.33-linux-glibc2.17-x86_64-minimal \/usr\/local\/mysql  <\/p>\n<p># \u5207\u6362\u5230MySQL\u5b89\u88c5\u76ee\u5f55<br \/>\n[root&#064;server \/]# cd \/usr\/local\/mysql  <\/p>\n<p># \u521b\u5efamysql\u7528\u6237\u7ec4&#xff08;\u7cfb\u7edf\u7ea7&#xff09;<br \/>\n[root&#064;server mysql]# groupadd mysql  <\/p>\n<p># \u521b\u5efamysql\u7cfb\u7edf\u7528\u6237&#xff08;\u7981\u6b62\u767b\u5f55&#xff0c;\u4ec5\u7528\u4e8e\u8fd0\u884c\u670d\u52a1&#xff09;<br \/>\n[root&#064;server mysql]# useradd -r -g mysql -s \/bin\/false mysql<br \/>\n# \u53c2\u6570\u8bf4\u660e&#xff1a;<br \/>\n# -r&#xff1a;\u521b\u5efa\u7cfb\u7edf\u7528\u6237&#xff08;UID&lt;1000&#xff09;<br \/>\n# -g&#xff1a;\u6307\u5b9a\u6240\u5c5e\u7528\u6237\u7ec4<br \/>\n# -s \/bin\/false&#xff1a;\u7981\u6b62\u7528\u6237\u767b\u5f55\u7cfb\u7edf<\/p>\n<p># \u521b\u5efa\u6570\u636e\u5b58\u50a8\u76ee\u5f55&#xff08;\u7528\u4e8e\u5907\u4efd\/\u6587\u4ef6\u5b58\u50a8&#xff09;<br \/>\n[root&#064;server mysql]# mkdir mysql-files  <\/p>\n<p># \u8bbe\u7f6e\u76ee\u5f55\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4&#xff08;\u4ec5mysql\u7528\u6237\/\u7ec4\u53ef\u8bbf\u95ee&#xff09;<br \/>\n[root&#064;server mysql]# chown mysql:mysql mysql-files  <\/p>\n<p># \u8bbe\u7f6e\u76ee\u5f55\u6743\u9650&#xff08;750&#xff1a;\u6240\u6709\u8005\u8bfb\/\u5199\/\u6267\u884c&#xff0c;\u7ec4\u53ea\u8bfb\/\u6267\u884c&#xff0c;\u5176\u4ed6\u65e0\u6743\u9650&#xff09;<br \/>\n[root&#064;server mysql]# chmod 750 mysql-files  <\/p>\n<h4>6.6 \u521d\u59cb\u5316\u4e0e\u4e34\u65f6\u542f\u52a8<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u521d\u59cb\u5316 MySQL&#xff08;\u751f\u6210\u4e34\u65f6\u5bc6\u7801&#xff09;<\/h5>\n<p># \u521d\u59cb\u5316&#xff08;\u6307\u5b9a\u8fd0\u884c\u7528\u6237\u4e3amysql&#xff0c;\u751f\u6210\u4e34\u65f6\u5bc6\u7801&#xff09;<br \/>\n[root&#064;server mysql]# bin\/mysqld &#8211;initialize &#8211;user&#061;mysql<br \/>\n# \u6ce8\u610f&#xff1a;\u6267\u884c\u540e\u4f1a\u8f93\u51fa\u4e34\u65f6\u5bc6\u7801&#xff0c;\u9700\u590d\u5236\u4fdd\u5b58&#xff08;\u793a\u4f8b&#xff1a;&amp;987kLpoi876!&#xff09;<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u914d\u7f6e SSL&#xff08;\u5b89\u5168\u901a\u4fe1&#xff09;<\/h5>\n<p># \u751f\u6210SSL\/RSA\u8bc1\u4e66&#xff08;\u7528\u4e8e\u52a0\u5bc6\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u7aef\u901a\u4fe1&#xff09;<br \/>\n[root&#064;server mysql]# bin\/mysql_ssl_rsa_setup  <\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u540e\u53f0\u542f\u52a8 MySQL<\/h5>\n<p># \u540e\u53f0\u542f\u52a8mysqld&#xff08;&amp;\u8868\u793a\u540e\u53f0\u8fd0\u884c&#xff09;<br \/>\n[root&#064;server mysql]# bin\/mysqld_safe &#8211;user&#061;mysql &amp;  <\/p>\n<h5>\u6b65\u9aa4 4&#xff1a;\u9a8c\u8bc1\u8fdb\u7a0b&#xff08;\u65b0\u5f00\u7ec8\u7aef&#xff09;<\/h5>\n<p># \u67e5\u770bMySQL\u8fdb\u7a0b&#xff08;\u786e\u8ba4\u542f\u52a8\u6210\u529f&#xff09;<br \/>\n[root&#064;server ~]# ps -ef | grep mysql<br \/>\n# \u793a\u4f8b\u8f93\u51fa&#xff1a;mysql     12345     1  0 10:00 ?        00:00:01 bin\/mysqld &#8211;user&#061;mysql&#8230;<\/p>\n<h5>\u6b65\u9aa4 5&#xff1a;\u89e3\u51b3\u5e93\u6587\u4ef6\u4f9d\u8d56&#xff08;\u5e38\u89c1\u95ee\u9898&#xff09;<\/h5>\n<p>\u82e5\u767b\u5f55\u65f6\u63d0\u793a\u300clibncurses.so.5\u300d\/\u300clibtinfo.so.5\u300d\u7f3a\u5931&#xff0c;\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p># \u521b\u5efa\u8f6f\u94fe\u63a5&#xff08;\u517c\u5bb9\u4f4e\u7248\u672c\u5e93\u4f9d\u8d56&#xff09;<br \/>\n[root&#064;server ~]# ln -s \/usr\/lib64\/libncurses.so.6 \/usr\/lib64\/libncurses.so.5<br \/>\n[root&#064;server ~]# ln -s \/usr\/lib64\/libtinfo.so.6 \/usr\/lib64\/libtinfo.so.5  <\/p>\n<h5>\u6b65\u9aa4 6&#xff1a;\u767b\u5f55\u5e76\u4fee\u6539\u5bc6\u7801<\/h5>\n<p># \u5207\u6362\u5230MySQL\u5b89\u88c5\u76ee\u5f55<br \/>\n[root&#064;server ~]# cd \/usr\/local\/mysql  <\/p>\n<p># \u767b\u5f55MySQL&#xff08;\u8f93\u5165\u4e34\u65f6\u5bc6\u7801&#xff09;<br \/>\n[root&#064;server mysql]# bin\/mysql -u root -p<br \/>\nEnter password: # \u7c98\u8d34\u521d\u59cb\u5316\u65f6\u7684\u4e34\u65f6\u5bc6\u7801<\/p>\n<p># \u4fee\u6539root\u5bc6\u7801&#xff08;\u6307\u5b9a\u8ba4\u8bc1\u63d2\u4ef6\u4e3amysql_native_password&#xff0c;\u517c\u5bb9\u65e7\u5ba2\u6237\u7aef&#xff09;<br \/>\nmysql&gt; alter user &#039;root&#039;&#064;&#039;localhost&#039; identified with mysql_native_password by &#039;123456&#039;;  <\/p>\n<p># \u5237\u65b0\u6743\u9650&#xff08;\u4f7f\u5bc6\u7801\u4fee\u6539\u751f\u6548&#xff09;<br \/>\nmysql&gt; flush privileges;  <\/p>\n<p># \u9000\u51faMySQL<br \/>\nmysql&gt; exit  <\/p>\n<p># \u53ef\u9009&#xff1a;\u5173\u95ed\u4e34\u65f6\u542f\u52a8\u7684MySQL\u8fdb\u7a0b&#xff08;\u540e\u7eed\u914d\u7f6e\u542f\u52a8\u811a\u672c\u540e\u91cd\u65b0\u542f\u52a8&#xff09;<br \/>\n[root&#064;server ~]# ps -ef | grep mysql  # \u627e\u5230\u8fdb\u7a0bPID<br \/>\n[root&#064;server ~]# kill -9 &lt;PID&gt;  # \u66ff\u6362\u4e3a\u5b9e\u9645PID<\/p>\n<h4>6.7 \u914d\u7f6e my.cnf&#xff08;\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6&#xff09;<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u521b\u5efa\u5e76\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/h5>\n<p>[root&#064;server ~]# vim \/etc\/my.cnf  <\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u5199\u5165\u914d\u7f6e\u5185\u5bb9<\/h5>\n<p># \u5ba2\u6237\u7aef\u914d\u7f6e\u6bb5&#xff08;\u6240\u6709MySQL\u5ba2\u6237\u7aef\u751f\u6548&#xff09;<br \/>\n[client]<br \/>\nport &#061; 3306                    # \u8fde\u63a5\u7aef\u53e3<br \/>\nsocket &#061; \/tmp\/mysql.sock       # \u672c\u5730\u5957\u63a5\u5b57\u6587\u4ef6&#xff08;\u6bd4TCP\u5feb&#xff09;<\/p>\n<p># \u670d\u52a1\u7aef\u914d\u7f6e\u6bb5&#xff08;mysqld\u8fdb\u7a0b\u751f\u6548&#xff09;<br \/>\n[mysqld]<br \/>\n# \u57fa\u7840\u6807\u8bc6<br \/>\nserver-id &#061; 1                  # \u670d\u52a1\u552f\u4e00ID&#xff08;\u96c6\u7fa4\u73af\u5883\u9700\u552f\u4e00&#xff09;<br \/>\nport &#061; 3306                    # \u76d1\u542c\u7aef\u53e3<br \/>\nbasedir &#061; \/usr\/local\/mysql     # MySQL\u5b89\u88c5\u6839\u76ee\u5f55<br \/>\ndatadir &#061; \/usr\/local\/mysql\/data # \u6570\u636e\u6587\u4ef6\u5b58\u50a8\u76ee\u5f55&#xff08;\u81ea\u52a8\u521b\u5efa&#xff09;<br \/>\ntmpdir &#061; \/tmp                  # \u4e34\u65f6\u6587\u4ef6\u76ee\u5f55&#xff08;\u5982\u5bfc\u5165\u6570\u636e\u65f6\u4f7f\u7528&#xff09;<br \/>\nsocket &#061; \/tmp\/mysql.sock       # \u5957\u63a5\u5b57\u6587\u4ef6\u8def\u5f84&#xff08;\u4e0e\u5ba2\u6237\u7aef\u4e00\u81f4&#xff09;<\/p>\n<p># \u5b57\u7b26\u96c6\u914d\u7f6e&#xff08;\u652f\u6301emoji\u7b49\u7279\u6b8a\u5b57\u7b26&#xff09;<br \/>\ncharacter-set-server &#061; utf8mb4 # \u670d\u52a1\u7aef\u9ed8\u8ba4\u5b57\u7b26\u96c6<br \/>\ncollation-server &#061; utf8mb4_general_ci # \u5b57\u7b26\u96c6\u6392\u5e8f\u89c4\u5219<br \/>\ninit_connect&#061;&#039;SET NAMES utf8mb4&#039; # \u5f3a\u5236\u5ba2\u6237\u7aef\u8fde\u63a5\u65f6\u4f7f\u7528utf8mb4<\/p>\n<p># \u5b58\u50a8\u5f15\u64ce<br \/>\ndefault-storage-engine&#061;INNODB  # \u9ed8\u8ba4\u5b58\u50a8\u5f15\u64ce&#xff08;\u4e8b\u52a1\u5b89\u5168\u3001\u884c\u7ea7\u9501&#xff09;<\/p>\n<p># \u65e5\u5fd7\u914d\u7f6e<br \/>\nlog_error &#061; error.log          # \u9519\u8bef\u65e5\u5fd7\u6587\u4ef6&#xff08;\u5b58\u50a8\u5728datadir\u4e0b&#xff09;<\/p>\n<h4>6.8 \u914d\u7f6e\u542f\u52a8\u811a\u672c&#xff08;\u7cfb\u7edf\u670d\u52a1\u5316&#xff09;<\/h4>\n<h5>\u6b65\u9aa4 1&#xff1a;\u62f7\u8d1d\u5e76\u4fee\u6539\u542f\u52a8\u811a\u672c<\/h5>\n<p># \u5207\u6362\u5230\u811a\u672c\u76ee\u5f55<br \/>\n[root&#064;server ~]# cd \/usr\/local\/mysql\/support-files  <\/p>\n<p># \u62f7\u8d1d\u542f\u52a8\u811a\u672c\u5230\u7cfb\u7edf\u670d\u52a1\u76ee\u5f55<br \/>\n[root&#064;server support-files]# cp -a mysql.server \/etc\/init.d\/mysql.server  <\/p>\n<p># \u7f16\u8f91\u542f\u52a8\u811a\u672c&#xff0c;\u6307\u5b9a\u5b89\u88c5\u76ee\u5f55\u548c\u6570\u636e\u76ee\u5f55<br \/>\n[root&#064;server support-files]# vim \/etc\/init.d\/mysql.server  <\/p>\n<p># \u5728\u811a\u672c\u5f00\u5934\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u884c&#xff08;\u6307\u5b9abasedir\u548cdatadir&#xff09;<br \/>\nbasedir&#061;\/usr\/local\/mysql<br \/>\ndatadir&#061;\/usr\/local\/mysql\/data<\/p>\n<h5>\u6b65\u9aa4 2&#xff1a;\u91cd\u8f7d\u670d\u52a1\u5e76\u542f\u52a8<\/h5>\n<p># \u91cd\u8f7d\u7cfb\u7edf\u670d\u52a1\u914d\u7f6e&#xff08;\u4f7f\u65b0\u811a\u672c\u751f\u6548&#xff09;<br \/>\n[root&#064;server ~]# systemctl daemon-reload  <\/p>\n<p># \u542f\u52a8mysql\u670d\u52a1&#xff08;\u901a\u8fc7\u7cfb\u7edf\u670d\u52a1&#xff09;<br \/>\n[root&#064;server ~]# systemctl start mysql  <\/p>\n<p># \u53ef\u9009&#xff1a;\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<br \/>\n[root&#064;server ~]# systemctl enable mysql<\/p>\n<h5>\u6b65\u9aa4 3&#xff1a;\u914d\u7f6e\u5168\u5c40\u73af\u5883\u53d8\u91cf<\/h5>\n<p># \u7f16\u8f91\u7528\u6237\u73af\u5883\u53d8\u91cf\u6587\u4ef6<br \/>\n[root&#064;server ~]# vim ~\/.bash_profile  <\/p>\n<p># \u6dfb\u52a0MySQL\u4e8c\u8fdb\u5236\u76ee\u5f55\u5230PATH<br \/>\nexport PATH&#061;$PATH:\/usr\/local\/mysql\/bin  <\/p>\n<p># \u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548<br \/>\n[root&#064;server ~]# source ~\/.bash_profile  <\/p>\n<p># \u9a8c\u8bc1&#xff08;\u4efb\u610f\u76ee\u5f55\u53ef\u6267\u884cmysql\u547d\u4ee4&#xff09;<br \/>\n[root&#064;server ~]# mysql -uroot -p<br \/>\nEnter password: 123456  # \u8f93\u5165\u5bc6\u7801\u5373\u53ef\u767b\u5f55<\/p>\n<h3>7 \u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/h3>\n<li>\u670d\u52a1\u542f\u52a8\u5931\u8d25&#xff1a;\u67e5\u770b\u9519\u8bef\u65e5\u5fd7\/var\/log\/mysqld.log&#xff08;Yum\/RPM \u5b89\u88c5&#xff09;\u6216\/usr\/local\/mysql\/data\/error.log&#xff08;\u4e8c\u8fdb\u5236\u5b89\u88c5&#xff09;&#xff1b;<\/li>\n<li>\u5bc6\u7801\u5fd8\u8bb0&#xff1a;\u505c\u6b62\u670d\u52a1\u2192\u8df3\u8fc7\u6743\u9650\u6821\u9a8c\u542f\u52a8\u2192\u91cd\u7f6e\u5bc6\u7801\u2192\u6062\u590d\u6b63\u5e38\u542f\u52a8&#xff08;\u751f\u4ea7\u73af\u5883\u9700\u8c28\u614e&#xff09;&#xff1b;<\/li>\n<li>\u7aef\u53e3\u5360\u7528&#xff1a;\u4f7f\u7528netstat -tulpn | grep 3306\u67e5\u770b\u5360\u7528\u8fdb\u7a0b&#xff0c;kill \u540e\u91cd\u542f\u670d\u52a1&#xff1b;<\/li>\n<li>\u6743\u9650\u4e0d\u8db3&#xff1a;\u786e\u4fdd\u6570\u636e\u76ee\u5f55 \/ \u5b89\u88c5\u76ee\u5f55\u6240\u6709\u8005\u4e3a mysql \u7528\u6237&#xff0c;\u6743\u9650\u4e3a 750\/640\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>1 \u4ec0\u4e48\u662f\u6570\u636e\u5e93 1.1 \u6570\u636e<br \/>\n\u6570\u636e\u662f\u63cf\u8ff0\u4e8b\u7269\u7684\u7b26\u53f7\u8bb0\u5f55&#xff0c;\u5176\u8868\u73b0\u5f62\u5f0f\u591a\u6837&#xff0c;\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6570\u5b57\u3001\u6587\u5b57\u3001\u56fe\u5f62\u3001\u56fe\u50cf\u3001\u58f0\u97f3\u3001\u8bed\u8a00\u7b49\u3002\u65e0\u8bba\u54ea\u79cd\u5f62\u5f0f&#xff0c;\u90fd\u53ef\u901a\u8fc7\u6570\u5b57\u5316\u5904\u7406\u540e\u5b58\u50a8\u5230\u8ba1\u7b97\u673a\u4e2d&#xff0c;\u662f\u6570\u636e\u5e93\u5b58\u50a8\u7684\u6838\u5fc3\u5bf9\u8c61\u3002<br \/>\n1.2 \u6570\u636e\u5e93<br \/>\n\u6570\u636e\u5e93&#xff08;Database&#xff0c;DB&#xff09;\u662f\u957f\u671f\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u5185\u3001\u6709\u7ec4\u7ec7\u3001\u53ef\u5171\u4eab\u7684\u5927\u91cf\u6570\u636e\u7684\u96c6\u5408\u3002\u5176\u6838\u5fc3\u7279\u5f81\u5982\u4e0b&#xff1a;<br \/>\n\u7279\u5f81\u8be6\u7ec6\u8bf4\u660e\u6570\u636e\u7ed3\u6784\u5316\u6570\u636e\u6309\u7167\u7edf\u4e00\u7684\u903b\u8f91<\/p>\n","protected":false},"author":2,"featured_media":60736,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[114,100],"topic":[],"class_list":["post-60743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mysql","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/60743.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1 \u4ec0\u4e48\u662f\u6570\u636e\u5e93 1.1 \u6570\u636e \u6570\u636e\u662f\u63cf\u8ff0\u4e8b\u7269\u7684\u7b26\u53f7\u8bb0\u5f55&#xff0c;\u5176\u8868\u73b0\u5f62\u5f0f\u591a\u6837&#xff0c;\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6570\u5b57\u3001\u6587\u5b57\u3001\u56fe\u5f62\u3001\u56fe\u50cf\u3001\u58f0\u97f3\u3001\u8bed\u8a00\u7b49\u3002\u65e0\u8bba\u54ea\u79cd\u5f62\u5f0f&#xff0c;\u90fd\u53ef\u901a\u8fc7\u6570\u5b57\u5316\u5904\u7406\u540e\u5b58\u50a8\u5230\u8ba1\u7b97\u673a\u4e2d&#xff0c;\u662f\u6570\u636e\u5e93\u5b58\u50a8\u7684\u6838\u5fc3\u5bf9\u8c61\u3002 1.2 \u6570\u636e\u5e93 \u6570\u636e\u5e93&#xff08;Database&#xff0c;DB&#xff09;\u662f\u957f\u671f\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u5185\u3001\u6709\u7ec4\u7ec7\u3001\u53ef\u5171\u4eab\u7684\u5927\u91cf\u6570\u636e\u7684\u96c6\u5408\u3002\u5176\u6838\u5fc3\u7279\u5f81\u5982\u4e0b&#xff1a; \u7279\u5f81\u8be6\u7ec6\u8bf4\u660e\u6570\u636e\u7ed3\u6784\u5316\u6570\u636e\u6309\u7167\u7edf\u4e00\u7684\u903b\u8f91\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/60743.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-16T01:41:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974d341da.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60743.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/60743.html\",\"name\":\"CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-16T01:41:35+00:00\",\"dateModified\":\"2026-01-16T01:41:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/60743.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/60743.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/60743.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CE(MySql\u670d\u52a1)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/60743.html","og_locale":"zh_CN","og_type":"article","og_title":"CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1 \u4ec0\u4e48\u662f\u6570\u636e\u5e93 1.1 \u6570\u636e \u6570\u636e\u662f\u63cf\u8ff0\u4e8b\u7269\u7684\u7b26\u53f7\u8bb0\u5f55&#xff0c;\u5176\u8868\u73b0\u5f62\u5f0f\u591a\u6837&#xff0c;\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6570\u5b57\u3001\u6587\u5b57\u3001\u56fe\u5f62\u3001\u56fe\u50cf\u3001\u58f0\u97f3\u3001\u8bed\u8a00\u7b49\u3002\u65e0\u8bba\u54ea\u79cd\u5f62\u5f0f&#xff0c;\u90fd\u53ef\u901a\u8fc7\u6570\u5b57\u5316\u5904\u7406\u540e\u5b58\u50a8\u5230\u8ba1\u7b97\u673a\u4e2d&#xff0c;\u662f\u6570\u636e\u5e93\u5b58\u50a8\u7684\u6838\u5fc3\u5bf9\u8c61\u3002 1.2 \u6570\u636e\u5e93 \u6570\u636e\u5e93&#xff08;Database&#xff0c;DB&#xff09;\u662f\u957f\u671f\u5b58\u50a8\u5728\u8ba1\u7b97\u673a\u5185\u3001\u6709\u7ec4\u7ec7\u3001\u53ef\u5171\u4eab\u7684\u5927\u91cf\u6570\u636e\u7684\u96c6\u5408\u3002\u5176\u6838\u5fc3\u7279\u5f81\u5982\u4e0b&#xff1a; \u7279\u5f81\u8be6\u7ec6\u8bf4\u660e\u6570\u636e\u7ed3\u6784\u5316\u6570\u636e\u6309\u7167\u7edf\u4e00\u7684\u903b\u8f91","og_url":"https:\/\/www.wsisp.com\/helps\/60743.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-16T01:41:35+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260116014133-6969974d341da.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/60743.html","url":"https:\/\/www.wsisp.com\/helps\/60743.html","name":"CE(MySql\u670d\u52a1) - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-16T01:41:35+00:00","dateModified":"2026-01-16T01:41:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/60743.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/60743.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/60743.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CE(MySql\u670d\u52a1)"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=60743"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/60743\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/60736"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=60743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=60743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=60743"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=60743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}