{"id":106,"date":"2025-08-13T20:12:32","date_gmt":"2025-08-13T12:12:32","guid":{"rendered":"https:\/\/www.mooloco.com\/?p=106"},"modified":"2025-08-13T20:14:45","modified_gmt":"2025-08-13T12:14:45","slug":"rhel%e7%b3%bb%e5%88%97%e5%ae%89%e8%a3%85mysql","status":"publish","type":"post","link":"https:\/\/www.mooloco.com\/?p=106","title":{"rendered":"RHEL\u7cfb\u5217\u5b89\u88c5MySQL"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em><code>yum<\/code> \u662f CentOS \u9ed8\u8ba4\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u4f60\u4ece CentOS \u7684\u5b98\u65b9\u4ed3\u5e93\u6216\u7b2c\u4e09\u65b9\u4ed3\u5e93\u4e2d\u8f7b\u677e\u5b89\u88c5\u8f6f\u4ef6\u3002\u4e3a\u4e86\u5b89\u88c5 MySQL\uff0c\u901a\u5e38\u6709\u4e24\u79cd\u5e38\u89c1\u65b9\u5f0f\uff1a\u5b89\u88c5 MySQL \u5b98\u65b9\u7684\u4ed3\u5e93\u7248\u672c\uff0c\u6216\u8005\u5b89\u88c5\u9ed8\u8ba4\u7684 MariaDB\uff08CentOS 7 \u9ed8\u8ba4\u5b89\u88c5\u7684\u6570\u636e\u5e93\uff09\u3002<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u8bf4\u660e\uff1aMariaDB \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u7531 MySQL \u7684\u539f\u59cb\u5f00\u53d1\u8005\u5728 Oracle \u6536\u8d2d MySQL \u540e\u5206\u652f\u5f00\u53d1\u800c\u6765\uff0c\u65e8\u5728\u4fdd\u6301\u5f00\u6e90\u548c\u793e\u533a\u9a71\u52a8\u7684\u7279\u6027\u3002\u5b83\u4e0e MySQL \u5728\u8bed\u6cd5\u3001API \u4ee5\u53ca\u6570\u636e\u6587\u4ef6\u683c\u5f0f\u4e0a\u9ad8\u5ea6\u517c\u5bb9\uff0c\u7528\u6237\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u53ef\u4ee5\u76f4\u63a5\u5c06 MySQL \u65e0\u7f1d\u8fc1\u79fb\u5230 MariaDB\u3002MariaDB \u7ee7\u627f\u4e86 MySQL \u7684\u9ad8\u6027\u80fd\u4e0e\u7a33\u5b9a\u6027\uff0c\u540c\u65f6\u5728\u7248\u672c\u66f4\u65b0\u4e2d\u4e0d\u65ad\u5f15\u5165\u65b0\u7684\u5b58\u50a8\u5f15\u64ce\u3001\u5b89\u5168\u673a\u5236\u548c\u4f18\u5316\u529f\u80fd\uff0c\u4f8b\u5982 Aria\u3001ColumnStore \u4ee5\u53ca\u66f4\u5148\u8fdb\u7684\u590d\u5236\u548c\u96c6\u7fa4\u65b9\u6848\u3002\u7531\u4e8e\u5176\u514d\u8d39\u3001\u8de8\u5e73\u53f0\u3001\u6027\u80fd\u4f18\u79c0\u4e14\u517c\u5bb9\u6027\u597d\uff0cMariaDB \u5728\u7f51\u7ad9\u5efa\u8bbe\u3001\u4f01\u4e1a\u5e94\u7528\u4ee5\u53ca\u4e91\u6570\u636e\u5e93\u670d\u52a1\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002<\/em><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_75 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E4%BD%BF%E7%94%A8%E5%AE%98%E6%96%B9_MySQL_%E4%BB%93%E5%BA%93%E5%AE%89%E8%A3%85_MySQL\" >\u4f7f\u7528\u5b98\u65b9 MySQL \u4ed3\u5e93\u5b89\u88c5 MySQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85MySQL%E7%9A%84%E5%AE%98%E6%96%B9YUM%E5%BA%93%E6%96%87%E4%BB%B6\" >\u4e0b\u8f7d\u5e76\u5b89\u88c5MySQL\u7684\u5b98\u65b9YUM\u5e93\u6587\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E5%AE%89%E8%A3%85_MySQL_YUM_%E4%BB%93%E5%BA%93\" >\u5b89\u88c5 MySQL YUM \u4ed3\u5e93<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E5%AE%89%E8%A3%85_MySQL\" >\u5b89\u88c5 MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E5%90%AF%E5%8A%A8_MySQL_%E6%9C%8D%E5%8A%A1%E5%B9%B6%E4%B8%94%E8%AE%BE%E7%BD%AE%E4%B8%BA%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\" >\u542f\u52a8 MySQL \u670d\u52a1\u5e76\u4e14\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E8%8E%B7%E5%8F%96%E4%B8%B4%E6%97%B6_root_%E5%AF%86%E7%A0%81\" >\u83b7\u53d6\u4e34\u65f6 root \u5bc6\u7801<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E9%85%8D%E7%BD%AE_MySQL\" >\u914d\u7f6e MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85\" >\u5b8c\u6210\u5b89\u88c5<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E4%BD%BF%E7%94%A8YUM%E4%BB%93%E5%BA%93%E9%87%8C%E9%BB%98%E8%AE%A4%E7%9A%84_MariaDB\" >\u4f7f\u7528YUM\u4ed3\u5e93\u91cc\u9ed8\u8ba4\u7684 MariaDB<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E2%80%9C%E6%9C%8D%E5%8A%A1%E4%B8%89%E6%9D%BF%E6%96%A7%E2%80%9D%EF%BC%9A%E5%AE%89%E8%A3%85%EF%BC%8C%E5%90%AF%E5%8A%A8%EF%BC%8C%E5%B9%B6%E4%B8%94%E8%AE%BE%E7%BD%AE%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\" >\u201c\u670d\u52a1\u4e09\u677f\u65a7\u201d\uff1a\u5b89\u88c5\uff0c\u542f\u52a8\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E9%85%8D%E7%BD%AE_MariaDB\" >\u914d\u7f6e MariaDB<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E7%99%BB%E5%BD%95_MariaDB\" >\u767b\u5f55 MariaDB<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E7%BB%93%E8%AF%AD\" >\u7ed3\u8bed<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E9%99%84%E5%8A%A0%EF%BC%9A%E4%BD%BF%E9%98%B2%E7%81%AB%E5%A2%99%E6%94%BE%E8%A1%8C%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AB%AF%E5%8F%A3\" >\u9644\u52a0\uff1a\u4f7f\u9632\u706b\u5899\u653e\u884c\u6570\u636e\u5e93\u7aef\u53e3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.mooloco.com\/?p=106\/#%E6%B0%B8%E4%B9%85%E6%94%BE%E8%A1%8C%E7%AB%AF%E5%8F%A3\" >\u6c38\u4e45\u653e\u884c\u7aef\u53e3<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E5%AE%98%E6%96%B9_MySQL_%E4%BB%93%E5%BA%93%E5%AE%89%E8%A3%85_MySQL\"><\/span><strong>\u4f7f\u7528\u5b98\u65b9 MySQL \u4ed3\u5e93\u5b89\u88c5 MySQL<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b98\u65b9 MySQL \u63d0\u4f9b\u4e86\u81ea\u5df1\u7684 YUM \u4ed3\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b89\u88c5\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85MySQL%E7%9A%84%E5%AE%98%E6%96%B9YUM%E5%BA%93%E6%96%87%E4%BB%B6\"><\/span>\u4e0b\u8f7d\u5e76\u5b89\u88c5MySQL\u7684\u5b98\u65b9YUM\u5e93\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u4e0b\u8f7drpm\u914d\u7f6e\u5305\uff1a<br><code>wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-3.noarch.rpm<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85_MySQL_YUM_%E4%BB%93%E5%BA%93\"><\/span>\u5b89\u88c5 MySQL YUM \u4ed3\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u521a\u624d\u4e0b\u8f7d\u7684rpm\u5305\uff1a<br><code>rpm -ivh mysql80-community-release-el7-3.noarch.rpm<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85_MySQL\"><\/span>\u5b89\u88c5 MySQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c MySQL \u5b98\u65b9\u4ed3\u5e93\u914d\u7f6e\u4e4b\u540e\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 <code>yum<\/code> \u5b89\u88c5 MySQL \u6570\u636e\u5e93\uff1a<br><code>yum install --nogpgcheck mysql-server<\/code><br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%90%AF%E5%8A%A8_MySQL_%E6%9C%8D%E5%8A%A1%E5%B9%B6%E4%B8%94%E8%AE%BE%E7%BD%AE%E4%B8%BA%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\"><\/span>\u542f\u52a8 MySQL \u670d\u52a1\u5e76\u4e14\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">systemctl start mysqld\nsystemctl enable mysqld<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%8E%B7%E5%8F%96%E4%B8%B4%E6%97%B6_root_%E5%AF%86%E7%A0%81\"><\/span>\u83b7\u53d6\u4e34\u65f6 root \u5bc6\u7801<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>MySQL \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f1a\u751f\u6210\u4e00\u4e2a\u4e34\u65f6\u7684 root \u5bc6\u7801\uff0c\u5e76\u4fdd\u5b58\u5728<code> \/var\/log\/mysqld.log<\/code> \u6587\u4ef6\u4e2d\u3002<\/strong><br><strong>\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a<\/strong><br><code>grep 'temporary password' \/var\/log\/mysqld.log<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE_MySQL\"><\/span>\u914d\u7f6e MySQL<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4e34\u65f6\u5bc6\u7801\u767b\u5f55 MySQL \u5e76\u8bbe\u7f6e\u65b0\u7684 root \u5bc6\u7801\uff1a<br><code>mysql -u root -p<\/code><br><br>\u7136\u540e\uff0c\u8f93\u5165\u4e34\u65f6\u5bc6\u7801\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7 <code>ALTER<\/code> \u8bed\u53e5\u4fee\u6539 root \u5bc6\u7801\uff1a<br><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'New_password';<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e76\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u5237\u65b0\u6570\u636e\u5e93\u6743\u9650\uff1a<br><code>FLUSH PRIVILEGES;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u6ce8\uff1aMySQL\u6709\u5bc6\u7801\u7684\u7b56\u7565\u8981\u6c42\uff0c\u7b80\u5355\u7684\u5bc6\u7801\u65e0\u6cd5\u901a\u8fc7MySQL\u7684\u8981\u6c42\uff0c\u8bf7\u5c3d\u91cf\u4f7f\u7528\u590d\u6742\u5bc6\u7801<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85\"><\/span>\u5b8c\u6210\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u5e76\u542f\u52a8MySQL\uff0c\u8bf7\u4f7f\u7528\u590d\u6742\u7684\u7ba1\u7406\u5bc6\u7801\uff0c\u5982\u6709\u5fc5\u8981\uff0c\u53ef\u9009\u4ec5\u5bf9localhost\u5f00\u653e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8YUM%E4%BB%93%E5%BA%93%E9%87%8C%E9%BB%98%E8%AE%A4%E7%9A%84_MariaDB\"><\/span><strong>\u4f7f\u7528YUM\u4ed3\u5e93\u91cc\u9ed8\u8ba4\u7684 MariaDB<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E2%80%9C%E6%9C%8D%E5%8A%A1%E4%B8%89%E6%9D%BF%E6%96%A7%E2%80%9D%EF%BC%9A%E5%AE%89%E8%A3%85%EF%BC%8C%E5%90%AF%E5%8A%A8%EF%BC%8C%E5%B9%B6%E4%B8%94%E8%AE%BE%E7%BD%AE%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF\"><\/span>\u201c\u670d\u52a1\u4e09\u677f\u65a7\u201d\uff1a\u5b89\u88c5\uff0c\u542f\u52a8\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">yum clean all &amp;&amp; yum makecache   #\u66f4\u65b0yum\u6570\u636e\u5e93\nyum install mariadb-server    #\u5b89\u88c5\nsystemctl start mariadb    #\u542f\u52a8\nsystemctl enable mariadb   #\u5f00\u673a\u81ea\u52a8\u542f\u52a8<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE_MariaDB\"><\/span>\u914d\u7f6e MariaDB<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c<code>mysql_secure_installation<\/code>\u4ee5\u521d\u59cb\u5316MariaDB\u3002<br><br>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u5f15\u5bfc\u4f60\u8bbe\u7f6e root \u5bc6\u7801\u3001\u5220\u9664\u533f\u540d\u7528\u6237\u3001\u7981\u7528\u8fdc\u7a0b root \u767b\u5f55\u7b49\u5b89\u5168\u914d\u7f6e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%99%BB%E5%BD%95_MariaDB\"><\/span>\u767b\u5f55 MariaDB<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>mysql -u root -p<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%BB%93%E8%AF%AD\"><\/span>\u7ed3\u8bed<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f7f\u7528 MySQL \u5b98\u65b9\u4ed3\u5e93<\/strong>\uff1a\u9002\u7528\u4e8e\u4f60\u9700\u8981\u5b89\u88c5 MySQL \u5b98\u65b9\u7248\u672c\u7684\u60c5\u51b5\u3002<\/li>\n\n\n\n<li><strong>\u4f7f\u7528 MariaDB<\/strong>\uff1aMariaDB \u662f CentOS \u9ed8\u8ba4\u7684\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 <code>yum<\/code> \u5b89\u88c5\uff0c\u901a\u5e38\u4e0e MySQL \u517c\u5bb9\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5 MySQL \u540e\uff0c\u522b\u5fd8\u4e86\u914d\u7f6e\u9632\u706b\u5899\u3001\u542f\u7528\u8fdc\u7a0b\u8bbf\u95ee\u7b49\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u5e93\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%99%84%E5%8A%A0%EF%BC%9A%E4%BD%BF%E9%98%B2%E7%81%AB%E5%A2%99%E6%94%BE%E8%A1%8C%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AB%AF%E5%8F%A3\"><\/span>\u9644\u52a0\uff1a\u4f7f\u9632\u706b\u5899\u653e\u884c\u6570\u636e\u5e93\u7aef\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B0%B8%E4%B9%85%E6%94%BE%E8%A1%8C%E7%AB%AF%E5%8F%A3\"><\/span>\u6c38\u4e45\u653e\u884c\u7aef\u53e3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">firewall-cmd --permanent --add-port=3306\/tcp  #\u653e\u884cTCP 3306\u7aef\u53e3\nfirewall-cmd --reload   #\u91cd\u65b0\u52a0\u8f7d\u9632\u706b\u5899\u89c4\u5219\nfirewall-cmd --list-ports # \u9a8c\u8bc1\u662f\u5426\u5df2\u7ecf\u653e\u884c\u3002\u5982\u679c\u8f93\u51fa\u91cc\u5305\u542b 3306\/tcp\uff0c\u8bf4\u660e\u89c4\u5219\u5df2\u751f\u6548\u3002<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60f3\u653e\u884c\u7ed9\u7279\u5b9a IP\uff0c\u800c\u4e0d\u662f\u5168\u90e8\u5f00\u653e\uff0c\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">firewall-cmd --permanent --add-rich-rule=\"rule family='ipv4' \\\nsource address='192.168.1.100' port protocol='tcp' port='3306' accept\" \\\nfirewall-cmd --reload<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\u53ea\u6709 <code>192.168.1.100<\/code> \u624d\u80fd\u8bbf\u95ee\u6570\u636e\u5e93\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9664\u4e86\u9632\u706b\u5899\uff0c\u8fd8\u8981\u786e\u4fdd MariaDB \u914d\u7f6e\u6587\u4ef6 <code>my.cnf<\/code> \u4e2d\u7684 <code>bind-address<\/code> \u5141\u8bb8\u5916\u90e8\u8bbf\u95ee\uff08\u9ed8\u8ba4\u53ef\u80fd\u662f <code>127.0.0.1<\/code>\u6216\u8005<code>localhost<\/code>\uff09<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>yum \u662f CentOS \u9ed8\u8ba4\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u4f60\u4ece CentOS \u7684\u5b98\u65b9\u4ed3\u5e93\u6216\u7b2c\u4e09\u65b9\u4ed3\u5e93\u4e2d\u8f7b\u677e\u5b89\u88c5\u8f6f\u4ef6 &#8230; <a title=\"RHEL\u7cfb\u5217\u5b89\u88c5MySQL\" class=\"read-more\" href=\"https:\/\/www.mooloco.com\/?p=106\" aria-label=\"\u9605\u8bfb RHEL\u7cfb\u5217\u5b89\u88c5MySQL\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=106"}],"version-history":[{"count":2,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":109,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=\/wp\/v2\/posts\/106\/revisions\/109"}],"wp:attachment":[{"href":"https:\/\/www.mooloco.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooloco.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}