{"id":279,"date":"2023-03-27T17:34:08","date_gmt":"2023-03-27T09:34:08","guid":{"rendered":"https:\/\/chenyl.fun\/?post_type=docs&#038;p=279"},"modified":"2023-03-27T17:35:44","modified_gmt":"2023-03-27T09:35:44","slug":"%e5%8d%b8%e8%bd%bd-%e5%ae%89%e8%a3%85mysql-mariadb","status":"publish","type":"docs","link":"https:\/\/chenyl.fun\/?docs=%e5%8d%b8%e8%bd%bd-%e5%ae%89%e8%a3%85mysql-mariadb","title":{"rendered":"\u5378\u8f7d\/\u5b89\u88c5mysql mariadb"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">\n<strong>**\u5378\u8f7d**<\/strong>\n\nyum remove mariadb*\n\n<strong>\u914d\u7f6e\u6dfb\u52a0yum\u6e90\u6587\u4ef6<\/strong>\n\nvim \/etc\/yum.repos.d\/mariadb.repo\n[mariadb]\nname = MariaDB\nbaseurl = http:\/\/archive.mariadb.org\/mariadb-10.0.10\/yum\/centos6-amd64\/\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck= 0\n\u5176\u4ed6\u7248\u672c\u8bf7\u53c2\u7167\u5b98\u7f51\u4fee\u6539\u7248\u672c\u53f7\nMariaDB 10.0 CentOS repository list - created 2016-05-30 02:16 UTC http:\/\/downloads.mariadb.org\/mariadb\/repositories\/\n\n<strong>**\u67e5\u914d\u7f6eyum\u6e90\u5bf9\u5e94\u7684mariadb\u7248\u672c\u662f\u5426\u6b63\u786e**<\/strong>\n\nyum makecache\nyum info MariaDB-server\n\u5b89\u88c5MariaDB-server\u548cClient\nyum install MariaDB-server MariaDB-client MariaDB-devel -y\n\u6ce8\uff1a\u5982\u679c\u6709\u63d0\u793a\u548c\u4ee5\u524d\u5b89\u88c5\u7684\u7248\u672c\u51b2\u7a81\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5148\u79fb\u9664\u4ee5\u524d\u5b89\u88c5\u7684\u5305\uff0c\u4f8b\u5982: yum remove mariadb-libs.\n\u65b0\u5efa\u6570\u636e\u76ee\u5f55\u5e76\u521b\u5efamysql\u7528\u6237\nmkdir -p \/data\/dbdata\/data\/ &amp;&amp; useradd mysql -s  \/sbin\/nologin\n\n<strong>**\u521d\u59cb\u5316\u6570\u636e\u5e93\u76ee\u5f55**<\/strong>\n\nmysql_install_db   --datadir='\/data\/dbdata\/data\/'\n\u6216\u8005\nmysql_install_db   --defaults-file=\/etc\/mariadb\/etc\/my.cnf\n\n<strong>**\u4fee\u6539\u6743\u9650\u5e76\u624b\u5de5\u547d\u4ee4\u542f\u52a8**<\/strong>\n\nchown mysql:mysl \/data\/dbdata\/data\/ -R\ncd '\/usr' ; \/usr\/bin\/mysqld_safe --datadir='\/data\/dbdata\/data\/' &amp;\n\u6216\u8005\nmysqld_safe --defaults-file=\/etc\/mariadb\/etc\/my.cnf &amp;\n\n<strong>**\u521d\u59cb\u5316\u6570\u636e\u5e93\u6743\u9650**<\/strong>\n\nmysql_secure_installation --defaults-file=\/etc\/mariadb\/etc\/my.cnf\n\u6216\u8005\nmysql -h 127.0.0.1 -uroot -p -P3307\ngrant all privileges on *.* to 'root'@'localhost' identified by 'password';\ngrant all privileges on *.* to 'root'@'127.0.0.1' identified by 'password';\nflush privileges \n\nhttps:\/\/blog.csdn.net\/weixin_42914965\/article\/details\/92588793<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>**\u5378\u8f7d** yum remove mariadb* \u914d\u7f6e\u6dfb\u52a0yum\u6e90\u6587\u4ef6 vim \/etc\/yum.repo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[20],"doc_tag":[],"_links":{"self":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/docs\/279"}],"collection":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=279"}],"version-history":[{"count":3,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/docs\/279\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/docs\/279\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_category&post=279"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}