{"id":1242,"date":"2021-08-07T15:08:43","date_gmt":"2021-08-07T07:08:43","guid":{"rendered":"https:\/\/www.dxQerp.cn\/?p=1242"},"modified":"2021-09-06T06:59:00","modified_gmt":"2021-09-05T22:59:00","slug":"how-to-install-mariadb-on-centos-8","status":"publish","type":"post","link":"http:\/\/www.dxQerp.cn\/?p=1242","title":{"rendered":"MariaDB \u5b89\u88dd\u5728 CentOS 8"},"content":{"rendered":"<h4>\u9996\u5148 \u770b \u8edf\u4ef6\u5305 \u662f\u5426\u6e96\u5099\u597d.<\/h4>\n\n\n<pre class=\"wp-block-code\"><code>dnf search mariadb<\/code><\/pre>\n\n\n\n<p><h4>\u57f7\u884c \u5b89\u88dd\u6307\u4ee4<\/h4><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf install @mariadb    # @mariadb \u6a21\u584a\u5b89\u88dd MariaDB \u670d\u52d9\u5668\u548c\u6240\u6709\u4f9d\u8cf4\u9805\u3002<\/code><\/pre>\n\n\n\n<p><h4>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 MariaDB \u670d\u52d9\u4e26\u901a\u904e\u9375\u5165\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u5176\u5728 <strong>\u555f\u52d5\u6642<\/strong> \u81ea\u52d5\u555f\u52d5<\/h4><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable --now mariadb<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><h4>\u8981\u9a57\u8b49 MariaDB \u670d\u52d9\u5668\u662f\u5426\u6b63\u5728\u904b\u884c\uff0c\u8acb\u9375\u5165<\/h4><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mariadb<\/code><\/pre>\n\n\n\n<p><h4>MariaDB \u670d\u52d9\u5668\u5305\u9644\u5e36\u4e00\u500b\u540d\u70ba mysql_secure_installation \u7684\u8173\u672c\uff0c\u8a72\u8173\u672c\u57f7\u884c\u591a\u9805\u8207\u5b89\u5168\u76f8\u95dc\u7684\u64cd\u4f5c\uff0c\u4e26\u8a2d\u7f6e root \u5bc6\u78bc\u3002<\/h4><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<p><h4>\u7cfb\u7d71\u5c07\u63d0\u793a\u60a8\u70ba MariaDB root \u8a2d\u7f6e\u5bc6\u78bc\u3002 \u57f7\u884c\u6b64\u64cd\u4f5c\u5f8c\uff0c\u8173\u672c\u9084\u6703\u8981\u6c42\u60a8\u522a\u9664\u533f\u540d\u7528\u6236\u3001\u9650\u5236 root \u8a2a\u554f\u672c\u5730\u8a08\u7b97\u6a5f\u4e26\u522a\u9664\u6e2c\u8a66\u6578\u64da\u5eab\u3002 \u60a8\u61c9\u8a72\u5c0d\u6240\u6709\u554f\u984c\u56de\u7b54\u201cY\u201d\uff08\u662f\uff09\u3002<\/h4><\/p>\n\n\n\n<p>\u5df2\u7d93\u5728 CentOS \u670d\u52d9\u5668\u4e0a\u5b89\u88dd\u4e26\u4fdd\u8b77\u4e86 MariaDB\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u901a\u904e <strong>\u7d42\u7aef\u6a5f <\/strong>\u4f5c\u70ba root \u5e33\u6236\u985e\u578b\u9023\u63a5\u5230 MariaDB \u670d\u52d9\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u51fa\u73fe\u63d0\u793a\u6642,&nbsp; &nbsp;\u8f38\u5165 root \u5bc6\u78bc\uff0c\u60a8\u5c07\u770b\u5230 MariaDB shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show databases;    # \u770b\u770b \u8cc7\u6599\u5eab \u6709\u54ea\u4e9b ?\nfirewall-cmd  --permanent --zone=public --add-port=3306\/tcp   # \u6253\u958b port(3306)<\/code><\/pre>\n\n\n\n<p>&nbsp;<strong>THE END<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u770b \u8edf\u4ef6\u5305 \u662f\u5426\u6e96\u5099\u597d. \u57f7\u884c \u5b89\u88dd\u6307\u4ee4 \u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 MariaDB \u670d\u52d9\u4e26\u901a\u904e\u9375\u5165\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u5176\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1264,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,12],"tags":[],"jetpack_featured_media_url":"http:\/\/www.dxQerp.cn\/wp-content\/uploads\/2021\/08\/MariaDB.png","_links":{"self":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1242"}],"collection":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1242"}],"version-history":[{"count":19,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1242\/revisions"}],"predecessor-version":[{"id":1501,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1242\/revisions\/1501"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/media\/1264"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1242"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}