{"id":18193,"date":"2014-02-17T06:42:34","date_gmt":"2014-02-16T22:42:34","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/02\/17\/%e5%9c%a8-centos-6-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-mariadb-%e8%b3%87%e6%96%99%e5%ba%ab\/"},"modified":"2021-03-18T17:23:50","modified_gmt":"2021-03-18T09:23:50","slug":"%e5%9c%a8-centos-6-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-mariadb-%e8%b3%87%e6%96%99%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/02\/17\/%e5%9c%a8-centos-6-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-mariadb-%e8%b3%87%e6%96%99%e5%ba%ab\/","title":{"rendered":"\u5728 CentOS 6.x \u4e0a\u5b89\u88dd MariaDB \u8cc7\u6599\u5eab"},"content":{"rendered":"<p>\u5728\u5b89\u88dd Linux \u6642\uff0c\u5927\u90e8\u5206\u4eba\u5728\u5b89\u88dd\u8cc7\u6599\u5eab\u6642\u90fd\u6703\u5b89\u88dd MySQL Server\uff0c\u800c\u6bd4\u8f03\u5c11\u5b89\u88dd PostgreSQL Server\uff0c\u5728 Oracle \u8cfc\u8cb7 MySQL \u4e4b\u5f8c\uff0c\u6709\u4e9b\u4f7f\u7528\u8005\u5c0d\u65bc Oracle \u4fdd\u6301\u4e0d\u4fe1\u4efb\u7684\u614b\u5ea6\uff0c\u8f49\u800c\u652f\u6301\u7531 MySQL \u516c\u53f8\u539f\u5275\u8fa6\u4eba Michael Widenius \u5148\u751f\u53e6\u5916\u958b\u767c\u4e86\u4e00\u500b\u65b0\u7684\u8cc7\u6599\u5eab\u7cfb\u7d71\uff0c\u5c31\u53eb\u505a MariaDB\uff0c\u4e26\u4e14\u8207\u539f\u5148\u7684 MySQL \u4fdd\u6301\u7d55\u4f73\u7684\u76f8\u5bb9\u6027\u3002 <br \/> MariaDB \u5b98\u65b9\u7db2\u7ad9\uff1a <a href=\"https:\/\/mariadb.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/mariadb.com\/<\/a> \u00a0 <a href=\"https:\/\/mariadb.org\/en\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/mariadb.org\/en\/<br \/><\/a> [@more@]\u5728 CentOS 6.x \u4e0b\u5b89\u88dd\u65b9\u5f0f\uff1a <br \/> 1. \u6700\u597d\u7684\u65b9\u5f0f\u662f\u5728\u5b89\u88dd\u6642\uff0c\u4e0d\u5b89\u88dd MySQL \u8cc7\u6599\u5eab\uff0c\u5426\u5247\u79fb\u9664\u76f8\u95dc\u5957\u4ef6\u6642\uff0c\u6703\u9047\u5230\u4e00\u4e9b\u554f\u984c\uff0c\u6211\u662f\u63a1\u7528\u6bd4\u8f03\u4e7e\u6de8\u7684\u65b9\u5f0f\u4f86\u5b89\u88dd <br \/> 2. \u4f9d\u7167\u5b98\u65b9\u7db2\u7ad9\u4e0a\u7684 <a href=\"https:\/\/downloads.mariadb.org\/mariadb\/repositories\/#mirror=uestc&amp;distro=CentOS\" target=\"_blank\" rel=\"noopener noreferrer\">\u5b89\u88dd\u8aaa\u660e<\/a> \uff0c\u5efa\u7acb\u5957\u4ef6\u5132\u5b58\u5eab\uff0c\u6709\u00a0 5.5 \u548c 10.0 \u4e8c\u500b\u7248\u672c\u53ef\u4ee5\u9078\u64c7 <br \/> # <span style=\"color: #ff0000\">vim \/etc\/yum.repos.d\/mariadb.repo<\/span><\/p>\n<pre class=\"highlight fixed\" style=\"padding-left: 30px\"><span style=\"color: #0000ff\"><code>#<\/code> MariaDB 5.5 CentOS repository list - created 2014-01-10 13:53 UTC <code> <br \/>#<\/code> <a href=\"http:\/\/mariadb.org\/mariadb\/repositories\/\"><span style=\"color: #0000ff\">http:\/\/mariadb.org\/mariadb\/repositories\/<\/span><\/a> <br \/>[mariadb] <\/span><br \/><span style=\"color: #0000ff\">name = MariaDB <\/span><br \/><span style=\"color: #0000ff\">baseurl = <a href=\"http:\/\/yum.mariadb.org\/5.5\/centos6-amd64\"><span style=\"color: #0000ff\">http:\/\/yum.mariadb.org\/5.5\/centos6-amd64<\/span><\/a> <br \/>gpgkey = <a href=\"https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\"><span style=\"color: #0000ff\">https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<\/span><\/a> <br \/>gpgcheck=1 <\/span><br \/><span style=\"color: #0000ff\"><br \/><code># <\/code>MariaDB 10.0 CentOS repository list - created 2014-01-10 13:54 UTC <code> <br \/># <\/code><a href=\"http:\/\/mariadb.org\/mariadb\/repositories\/\"><span style=\"color: #0000ff\">http:\/\/mariadb.org\/mariadb\/repositories\/<\/span><\/a> <br \/>[mariadb] <\/span><br \/><span style=\"color: #0000ff\">name = MariaDB <\/span><br \/><span style=\"color: #0000ff\">baseurl = <a href=\"http:\/\/yum.mariadb.org\/10.0\/centos6-amd64\"><span style=\"color: #0000ff\">http:\/\/yum.mariadb.org\/10.0\/centos6-amd64<\/span><\/a> <br \/>gpgkey = <a href=\"https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\"><span style=\"color: #0000ff\">https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<\/span><\/a> <br \/>gpgcheck=1<\/span>\n    <br \/>   \n<\/pre>\n<p>\u66f4\u65b0\u5957\u4ef6\u5eab<br \/># <span style=\"color: #ff0000\">yum update<\/span><\/p>\n<p>\u5b89\u88dd MariaDB<br \/># <span style=\"color: #ff0000\">yum -y install MariaDB-server MariaDB-client<\/span><\/p>\n<p>\u555f\u52d5 MariaDB<br \/># <span style=\"color: #ff0000\">service mysql start<\/span><\/p>\n<p>\u958b\u6a5f\u5f8c\u555f\u52d5<br \/># <span style=\"color: #ff0000\">chkconfig &#8211;level 3 mysql on<\/span><\/p>\n<p>\u5b89\u88dd\u5b8c\u6210\u7684\u8a2d\u5b9a<br \/># <span style=\"color: #ff0000\">\/usr\/bin\/mysql_secure_installation<\/span><br \/><span style=\"color: #ff0000\">\/usr\/bin\/mysql_secure_installation: line 379: find_mysql_client\uff1a\u547d\u4ee4\u627e\u4e0d\u5230<\/span><\/p>\n<p><span style=\"color: #0000ff\">NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<\/span><br \/><span style=\"color: #0000ff\">\u00a0\u00a0\u00a0\u00a0\u00a0 SERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!<\/span><\/p>\n<p><span style=\"color: #0000ff\">In order to log into MariaDB to secure it, we&#8217;ll need the current<\/span><br \/><span style=\"color: #0000ff\">password for the root user.\u00a0 If you&#8217;ve just installed MariaDB, and<\/span><br \/><span style=\"color: #0000ff\">you haven&#8217;t set the root password yet, the password will be blank,<\/span><br \/><span style=\"color: #0000ff\">so you should just press enter here.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Enter current password for root (enter for none):<\/span><br \/><span style=\"color: #0000ff\">OK, successfully used password, moving on&#8230;<\/span><\/p>\n<p><span style=\"color: #0000ff\">Setting the root password ensures that nobody can log into the MariaDB<\/span><br \/><span style=\"color: #0000ff\">root user without the proper authorisation.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Set root password? [Y\/n]<\/span><br \/><span style=\"color: #0000ff\">New password:<\/span><br \/><span style=\"color: #0000ff\">Re-enter new password:<\/span><br \/><span style=\"color: #0000ff\">Password updated successfully!<\/span><br \/><span style=\"color: #0000ff\">Reloading privilege tables..<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><\/p>\n<p><span style=\"color: #0000ff\">By default, a MariaDB installation has an anonymous user, allowing anyone<\/span><br \/><span style=\"color: #0000ff\">to log into MariaDB without having to have a user account created for<\/span><br \/><span style=\"color: #0000ff\">them.\u00a0 This is intended only for testing, and to make the installation<\/span><br \/><span style=\"color: #0000ff\">go a bit smoother.\u00a0 You should remove them before moving into a<\/span><br \/><span style=\"color: #0000ff\">production environment.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Remove anonymous users? [Y\/n]<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><\/p>\n<p><span style=\"color: #0000ff\">Normally, root should only be allowed to connect from &#8216;localhost&#8217;.\u00a0 This<\/span><br \/><span style=\"color: #0000ff\">ensures that someone cannot guess at the root password from the network.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Disallow root login remotely? [Y\/n]<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><\/p>\n<p><span style=\"color: #0000ff\">By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<\/span><br \/><span style=\"color: #0000ff\">access.\u00a0 This is also intended only for testing, and should be removed<\/span><br \/><span style=\"color: #0000ff\">before moving into a production environment.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Remove test database and access to it? [Y\/n]<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8211; Dropping test database&#8230;<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8211; Removing privileges on test database&#8230;<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><\/p>\n<p><span style=\"color: #0000ff\">Reloading the privilege tables will ensure that all changes made so far<\/span><br \/><span style=\"color: #0000ff\">will take effect immediately.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Reload privilege tables now? [Y\/n]<\/span><br \/><span style=\"color: #0000ff\">\u00a0&#8230; Success!<\/span><\/p>\n<p><span style=\"color: #0000ff\">Cleaning up&#8230;<\/span><\/p>\n<p><span style=\"color: #0000ff\">All done!\u00a0 If you&#8217;ve completed all of the above steps, your MariaDB<\/span><br \/><span style=\"color: #0000ff\">installation should now be secure.<\/span><\/p>\n<p><span style=\"color: #0000ff\">Thanks for using MariaDB!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b89\u88dd Linux \u6642\uff0c\u5927\u90e8\u5206\u4eba\u5728\u5b89\u88dd\u8cc7\u6599\u5eab\u6642\u90fd\u6703\u5b89\u88dd MySQL Server\uff0c\u800c\u6bd4\u8f03\u5c11\u5b89\u88dd Postgre &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/02\/17\/%e5%9c%a8-centos-6-x-%e4%b8%8a%e5%ae%89%e8%a3%9d-mariadb-%e8%b3%87%e6%96%99%e5%ba%ab\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u5728 CentOS 6.x \u4e0a\u5b89\u88dd MariaDB \u8cc7\u6599\u5eab\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,116],"tags":[],"class_list":["post-18193","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-78461"],"meta_key":{"_encloseme":["1"],"lt_post_id":["471141"],"_pingme":["1"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18193"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=18193"}],"version-history":[{"count":1,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18193\/revisions"}],"predecessor-version":[{"id":19856,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18193\/revisions\/19856"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=18193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=18193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=18193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}