{"id":1101,"date":"2021-08-12T14:40:22","date_gmt":"2021-08-12T06:40:22","guid":{"rendered":"http:\/\/www.dxQerp.com\/?p=1101"},"modified":"2021-09-03T05:49:33","modified_gmt":"2021-09-02T21:49:33","slug":"how-to-install-mariadb-on-centos-8","status":"publish","type":"post","link":"http:\/\/www.dxQerp.com\/?p=1101","title":{"rendered":"How to Install MariaDB on 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>&nbsp;<\/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>&nbsp;<\/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><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":1134,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11,12],"tags":[],"class_list":["post-1101","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mariadb","category-mysql-problems"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.dxQerp.com\/wp-content\/uploads\/2021\/08\/MariaDB.png?fit=760%2C332","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1101"}],"version-history":[{"count":2,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1101\/revisions"}],"predecessor-version":[{"id":1147,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/posts\/1101\/revisions\/1147"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=\/wp\/v2\/media\/1134"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1101"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}