{"id":1076,"date":"2017-11-10T12:00:00","date_gmt":"2017-11-10T03:00:00","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1076"},"modified":"2022-07-09T23:33:57","modified_gmt":"2022-07-09T14:33:57","slug":"mariadb%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/web\/1076","title":{"rendered":"MariaDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>MySQL\u5165\u308c\u3061\u3083\u3063\u305f\u3051\u3069\u3084\u3063\u3071\u308aMariaDB\u306b\u3059\u308b\u3002<\/p>\n<h4>\u53c2\u8003URL<\/h4>\n<ul>\n<li><a href=\"https:\/\/knowledge.sakura.ad.jp\/9006\/\">\u30cd\u30b3\u3067\u3082\u308f\u304b\u308b\uff01\u3055\u304f\u3089\u306eVPS\u8b1b\u5ea7 \uff5e\u7b2c\u56db\u56de\u300cphp\u3068MariaDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u300d<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4>MariaDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h4>\n<pre><code class=\"language-sh\"># yum install mariadb<\/code><\/pre>\n<pre><code>&lt;!--more--&gt;\n Package                    Arch                 Version                         Repository          Size\n&lt;!--more--&gt;\nInstalling:\n mariadb                    x86_64               1:5.5.56-2.el7                  base               8.7 M\nInstalling for dependencies:\n mariadb-libs               x86_64               1:5.5.56-2.el7                  base               757 k<\/code><\/pre>\n<pre><code class=\"language-sh\"># yum install mariadb-server<\/code><\/pre>\n<pre><code>&lt;!--more--&gt;\n Package                             Arch               Version                    Repository        Size\n&lt;!--more--&gt;\nInstalling:\n mariadb-server                      x86_64             1:5.5.56-2.el7             base              11 M\nInstalling for dependencies:\n perl-Compress-Raw-Bzip2             x86_64             2.061-3.el7                base              32 k\n perl-Compress-Raw-Zlib              x86_64             1:2.061-4.el7              base              57 k\n perl-DBD-MySQL                      x86_64             4.023-5.el7                base             140 k\n perl-DBI                            x86_64             1.627-4.el7                base             802 k\n perl-IO-Compress                    noarch             2.061-2.el7                base             260 k\n perl-Net-Daemon                     noarch             0.48-5.el7                 base              51 k\n perl-PlRPC                          noarch             0.2020-14.el7              base              36 k<\/code><\/pre>\n<h5>\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8<\/h5>\n<pre><code class=\"language-sh\"># yum list available | grep mariadb       \nmariadb-bench.x86_64                    1:5.5.56-2.el7                 base     \nmariadb-devel.i686                      1:5.5.56-2.el7                 base     \nmariadb-devel.x86_64                    1:5.5.56-2.el7                 base     \nmariadb-embedded.i686                   1:5.5.56-2.el7                 base     \nmariadb-embedded.x86_64                 1:5.5.56-2.el7                 base     \nmariadb-embedded-devel.i686             1:5.5.56-2.el7                 base     \nmariadb-embedded-devel.x86_64           1:5.5.56-2.el7                 base     \nmariadb-libs.i686                       1:5.5.56-2.el7                 base     \nmariadb-test.x86_64                     1:5.5.56-2.el7                 base  <\/code><\/pre>\n<h4>MariaDB\u3092\u8d77\u52d5\u3059\u308b<\/h4>\n<ul>\n<li>Apache\u3068\u540c\u3058\u30b3\u30de\u30f3\u30c9\u3002<\/li>\n<\/ul>\n<pre><code class=\"language-sh\"># systemctl start mariadb<\/code><\/pre>\n<h4>\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u6642\u306bMariaDB\u3082\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3059\u308b<\/h4>\n<ul>\n<li>Apache\u3067\u3084\u3063\u305f\u306e\u3068\u540c\u3058\u30b3\u30de\u30f3\u30c9\u3002<\/li>\n<\/ul>\n<pre><code class=\"language-sh\"># systemctl enable mariadb<\/code><\/pre>\n<ul>\n<li>\u30ea\u30b9\u30c8\u3067\u78ba\u8a8d\n<ul>\n<li>enabled\u306b\u306a\u3063\u3066\u3044\u308c\u3070OK<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"language-sh\"># systemctl list-unit-files -t service | grep mariadb\nmariadb.service                               enabled<\/code><\/pre>\n<h4>MariaDB\u306e\u521d\u671f\u8a2d\u5b9a<\/h4>\n<pre><code class=\"language-sh\"># mysql_secure_installation<\/code><\/pre>\n<pre><code>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\n\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user.  If you've just installed MariaDB, and\nyou haven't set the root password yet, the password will be blank,\nso you should just press enter here.\n\nEnter current password for root (enter for none): <\/code><\/pre>\n<ul>\n<li>\u4f55\u3082\u5165\u529b\u305b\u305aReturn<\/li>\n<\/ul>\n<pre><code>OK, successfully used password, moving on...\n\nSetting the root password ensures that nobody can log into the MariaDB\nroot user without the proper authorisation.\n\nSet root password? [Y\/n] y\nNew password: \nRe-enter new password: \nPassword updated successfully!\nReloading privilege tables..\n ... Success!<\/code><\/pre>\n<ul>\n<li>root\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u8a2d\u5b9a\u5b8c\u4e86<\/li>\n<\/ul>\n<pre><code>By default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem.  This is intended only for testing, and to make the installation\ngo a bit smoother.  You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] y\n ... Success!<\/code><\/pre>\n<pre><code>Normally, root should only be allowed to connect from 'localhost'.  This\nensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] y\n ... Success!<\/code><\/pre>\n<pre><code>By default, MariaDB comes with a database named 'test' that anyone can\naccess.  This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] y\n - Dropping test database...\n ... Success!\n - Removing privileges on test database...\n ... Success!<\/code><\/pre>\n<pre><code>Reloading the privilege tables will ensure that all changes made so far\nwill take effect immediately.\n\nReload privilege tables now? [Y\/n] y\n ... Success!<\/code><\/pre>\n<pre><code>Cleaning up...\n\nAll done!  If you've completed all of the above steps, your MariaDB\ninstallation should now be secure.\n\nThanks for using MariaDB!<\/code><\/pre>\n<h4>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306broot\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b<\/h4>\n<pre><code class=\"language-sh\"># mysql -u root -p\nEnter password:<\/code><\/pre>\n<pre><code>Welcome to the MariaDB monitor.  Commands end with ; or g.\nYour MariaDB connection id is 10\nServer version: 5.5.56-MariaDB MariaDB Server\n\nCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or 'h' for help. Type 'c' to clear the current input statement.\n\nMariaDB [(none)]&gt;<\/code><\/pre>\n<h5>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u307f\u3066\u307f\u308b<\/h5>\n<pre><code>MariaDB [(none)]&gt; show databases;\n1. --------------------+\n| Database           |\n1. --------------------+\n| information_schema |\n| mysql              |\n| performance_schema |\n1. --------------------+\n3 rows in set (0.00 sec)<\/code><\/pre>\n<h4>MariaDB\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b<\/h4>\n<pre><code class=\"language-sh\"># mysql --version\nmysql  Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n<ul>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5165\u3063\u3066\u304b\u3089\u4e0b\u8a18\u5b9f\u884c\u3057\u3066\u3082\u78ba\u8a8d\u3067\u304d\u308b\u3002\n<pre><code>MariaDB [(none)]&gt; select version();\n1. ----------------+\n| version()      |\n1. ----------------+\n| 5.5.56-MariaDB |\n1. ----------------+\n1 row in set (0.00 sec)<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u5165\u308c\u3061\u3083\u3063\u305f\u3051\u3069\u3084\u3063\u3071\u308aMariaDB\u306b\u3059\u308b\u3002 \u53c2\u8003URL \u30cd\u30b3\u3067\u3082\u308f\u304b\u308b\uff01\u3055\u304f\u3089\u306eVPS\u8b1b\u5ea7 \uff5e\u7b2c\u56db\u56de\u300cphp\u3068MariaDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u300d<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[50,48],"class_list":["post-1076","post","type-post","status-publish","format-standard","hentry","category-web","tag-mysql","tag-server"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1076"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1076\/revisions"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}