<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://www.seirios.org/seirios/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>ほほほのほ - serverapp:database:mariadb</title>
        <description></description>
        <link>http://www.seirios.org/seirios/dokuwiki/</link>
        <lastBuildDate>Wed, 29 Apr 2026 23:03:15 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>http://www.seirios.org/seirios/dokuwiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>ほほほのほ</title>
            <link>http://www.seirios.org/seirios/dokuwiki/</link>
        </image>
        <item>
            <title>MariaDBの初期設定</title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=serverapp:database:mariadb:initial-config</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;mariadbの初期設定&quot;&gt;MariaDBの初期設定&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;em class=&quot;u&quot;&gt;&lt;strong&gt; Last Update: 2015/11/19 &lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 起動の準備&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; CentOS&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/my.cnf.d/server.cnf&lt;/code&gt;を修正。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; FreeBSD&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/usr/local/etc/my.cnf&lt;/code&gt;を作成。CentOSと同じように、my.cnf.dをつくってmy.cnfから読むようにしても良い&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;[mysqld]&lt;/code&gt;セクションに&lt;code&gt;character-set-server=utf8&lt;/code&gt;をとにかく足す&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; MariaDB Serverを起動する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; CentOS&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; service mysql start&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; service mariadb では無いことに注意&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; FreeBSD&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; vi /etc/rc.conf&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;mysql_enable=&amp;quot;YES&amp;quot;
mysql_limits=&amp;quot;NO&amp;quot;
mysql_dbdir=&amp;quot;any/where&amp;quot;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; default以外の場所にDBのDirを切るなら、mkdir して、permissionをmysql:mysqlにしておくこと&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; 細かいDirも作成し、permissionを変更すること&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; service mysql-server start&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 立ち上がったら、&lt;code&gt;mysql_secure_installation&lt;/code&gt;を実行して、root password等の設定を行う&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; もし立ち上がらなかったら、&lt;code&gt;mysql_install_db&lt;/code&gt; scriptを実行すること。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; FreeBSDの場合、&lt;code&gt;/usr/local/bin/mysql_install_db –basedir=/usr/local –datadir=…&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; もしかすると、mysql.sockを/tmpにsymlinkする必要があるかもしれない。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;[foo@bar ~]$ sudo mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: コマンドが見つかりません

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we&amp;#039;ll need the current
password for the root user.  If you&amp;#039;ve just installed MariaDB, and
you haven&amp;#039;t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: ****************
Re-enter new password: ****************

Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from &amp;#039;localhost&amp;#039;.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named &amp;#039;test&amp;#039; that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you&amp;#039;ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[foo@bar ~]$ &lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; これで、MariaDBに繋いでみて、問題が無ければOK&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;mysql -u root -p&lt;/code&gt; (コマンド名がmysqlなので注意すること)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; とにかく、初期状態を確認&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;MariaDB [(none)]&amp;gt; \s
--------------
mysql  Ver 15.1 Distrib 5.5.34-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:		10
Current database:	
Current user:		root@localhost
SSL:			Not in use
Current pager:		stdout
Using outfile:		&amp;#039;&amp;#039;
Using delimiter:	;
Server:			MariaDB
Server version:		5.5.34-MariaDB MariaDB Server
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8
Db     characterset:	utf8
Client characterset:	utf8
Conn.  characterset:	utf8
UNIX socket:		/var/lib/mysql/mysql.sock
Uptime:			18 min 7 sec

Threads: 1  Questions: 28  Slow queries: 0  Opens: 1  Flush tables: 2  Open tables: 27  Queries per second avg: 0.025
--------------

MariaDB [(none)]&amp;gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; ついでに、Pluginも確認しておく。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;MariaDB [(none)]&amp;gt; show plugins;
+--------------------------------+----------+--------------------+---------+---------+
| Name                           | Status   | Type               | Library | License |
+--------------------------------+----------+--------------------+---------+---------+
| binlog                         | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| mysql_native_password          | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| mysql_old_password             | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| CSV                            | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MEMORY                         | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MyISAM                         | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MRG_MYISAM                     | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| BLACKHOLE                      | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| InnoDB                         | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| INNODB_RSEG                    | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_UNDO_LOGS               | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_TRX                     | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCKS                   | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCK_WAITS              | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP                     | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP_RESET               | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM                  | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM_RESET            | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_TABLES              | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_TABLESTATS          | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_INDEXES             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_COLUMNS             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_FIELDS              | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_FOREIGN             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_FOREIGN_COLS        | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_SYS_STATS               | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_TABLE_STATS             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_INDEX_STATS             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_POOL_PAGES       | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_POOL_PAGES_INDEX | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_POOL_PAGES_BLOB  | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| XTRADB_ADMIN_COMMAND           | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CHANGED_PAGES           | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_PAGE             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_PAGE_LRU         | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_POOL_STATS       | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| FEDERATED                      | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| ARCHIVE                        | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| PERFORMANCE_SCHEMA             | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| Aria                           | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| FEEDBACK                       | DISABLED | INFORMATION SCHEMA | NULL    | GPL     |
| partition                      | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
+--------------------------------+----------+--------------------+---------+---------+
42 rows in set (0.00 sec)

MariaDB [(none)]&amp;gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; なお、MySQLと同じ方法で、Semisync Pluginsも入る。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;MariaDB\u306e\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mariadb\u306e\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-8565&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;追加の設定&quot;&gt;追加の設定&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
ここまでできたら、MariaDBは動作している状態になる。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 追加設定をいくつか。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/my.cnf.d/server.cnf&lt;/code&gt; の &lt;code&gt;[mysqld]&lt;/code&gt; セクションに以下を追加&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;plugin-load = handlersocket.so;semisync_master.so;semisync_slave.so&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;;&lt;/code&gt;の前後に&lt;code&gt; &lt;/code&gt;(スペース)等を入れてはいけません。(はまる)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; handlersocket: 高速化Plugin.(正確には、ストレージエンジンへの直接のアクセスを提供するものらしい)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; semisync_master: SemiSynchronas Replication用のPlugin。Master側&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; semisync_slave: SemiSynchronas Replication用のPlugin。Slave側&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u8ffd\u52a0\u306e\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u8ffd\u52a0\u306e\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;8566-9260&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;db管理者アカウントを追加&quot;&gt;DB管理者アカウントを追加&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ol&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 必要なAccountを作成すればOK&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 特権管理者を作成する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;$ mysql -u root -p
MariaDB [(none)]&amp;gt; grant all privileges on *.* to foo@localhost identified by &amp;#039;DB Ultra Secret&amp;#039;;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]&amp;gt; grant all privileges on *.* to foo@127.0.0.1 identified by &amp;#039;DB Ultra Secret&amp;#039;;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]&amp;gt; grant all privileges on *.* to foo@::1 identified by &amp;#039;DB Ultra Secret&amp;#039;;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]&amp;gt; flush privileges;
Query OK, 0 rows affected (0.00 sec)&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; これで、rootでDBを触る必要がなくなる。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; 但し、これは、単にrootに匹敵する特権アカウントを作っただけなので、管理には十分に注意すること&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; 本来であれば、権限をちゃんと分離するべきなので、そこに十分に注意すること&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; GRANT権限まで付与する場合には、WITH GRANT OPTIONを追加すること&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;DB\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u8ffd\u52a0&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;db\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u8ffd\u52a0&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;9261-10321&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;起動時にmariddbが動作するようにする&quot;&gt;起動時にMaridDBが動作するようにする&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
再起動時にMariaDBが動作するようにする。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; CentOS&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;chkconfig mysql on&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; FreeBSD&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; /etc/rc.confに以下を設定&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;mysql_enable=&amp;quot;YES&amp;quot;
mysql_limits=&amp;quot;NO&amp;quot;
mysql_dbdir=&amp;quot;/var/db/mysql&amp;quot;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u8d77\u52d5\u6642\u306bMaridDB\u304c\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3059\u308b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u8d77\u52d5\u6642\u306bmariddb\u304c\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3059\u308b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;10322-10626&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;mariadbの設定ファイル&quot;&gt;MariaDBの設定ファイル&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;dl class=&quot;file&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=serverapp:database:mariadb:initial-config&amp;amp;codeblock=7&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_cnf&quot;&gt;server.cnf&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;file&quot;&gt;#
# /etc/my.cnf.d/server.cnf
#
# Configuration for MariaDB server.
#

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]
user=mysql
datadir=/var/lib/mysql/DB
# datadir=/var/db/mysql
bind-address=127.0.0.1
character-set-server=utf8
#skip-character-set-client-handshake
skip-name-resolve

expire_logs_days=7
#log_output=&amp;quot;NONE&amp;quot;
log_output=&amp;quot;FILE&amp;quot;
#log_output=&amp;quot;FILE,TABLE&amp;quot;
#general-log=0
general-log=1
general-log-file=/var/lib/mysql/log/mysql
#general-log-file=/var/db/mysql/log/mysql
log_error=/var/lib/mysql/log/mysql-error
#log_error=/var/db/mysql/log/mysql-error
#slow_query_log=0
slow_query_log=1
slow_query_log_file = /var/lib/mysql/log/mysql-slow.log
#slow_query_log_file = /var/db/mysql/log/mysql-slow.log
max_binlog_size=100M
sync_binlog=1
binlog_format=mixed
log_bin=/var/lib/mysql/log/mysql-bin
#log_bin=/var/db/mysql/log/mysql-bin
relay_log=/var/lib/mysql/log/mysql-relay
relay_log=/var/db/mysql/log/mysql-relay
log_slave_updates

key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8

innodb_buffer_pool_size = 768M
innodb_log_file_size = 128M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_support_xa=1
innodb_log_files_in_group = 7
innodb_autoextend_increment=64
innodb_file_per_table

plugin-load = handlersocket.so;semisync_master.so;semisync_slave.so

#rpl_semi_sync_master_enabled =1
#rpl_semi_sync_slave_enabled = 1
#rpl_semi_sync_master_timeout=30

# this is only for embedded server
[embedded]

# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don&amp;#039;t understand
[mysqld-5.5]

# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]

[mariadb-5.5]
&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;
なお、この設定では、SQL Queryのlogや、slow logも収集するようになっているので、必要に応じてOffにすること。
このままでは性能が劣化します。&lt;br/&gt;

slow-logを取得する際には、mysql-slow をtouchすること
&lt;/p&gt;

&lt;p&gt;
加えて、うかつにinnodb_log_buffer_sizeやinnodb_log_files_in_groupを書き換えると起動しなくなります。
そういう場合には、&lt;a href=&quot;http://gitpub.hatenablog.com/entry/2013/08/02/001600&quot; class=&quot;urlextern&quot; title=&quot;http://gitpub.hatenablog.com/entry/2013/08/02/001600&quot;&gt;http://gitpub.hatenablog.com/entry/2013/08/02/001600&lt;/a&gt;を参照して作業すること。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;MariaDB\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mariadb\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:7,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;10627-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 20 Nov 2015 07:21:36 +0000</pubDate>
        </item>
        <item>
            <title>OSにMariaDBをInsatll</title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=serverapp:database:mariadb:inst-centos</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;osにmariadbをinsatll&quot;&gt;OSにMariaDBをInsatll&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;em class=&quot;u&quot;&gt;&lt;strong&gt; Last Update: 2015/11/19 &lt;/strong&gt;&lt;/em&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;OS\u306bMariaDB\u3092Insatll&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;os\u306bmariadb\u3092insatll&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-73&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;centos&quot;&gt;CentOS&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?id=os:linux:yum#mariadb&quot; class=&quot;wikilink2&quot; title=&quot;os:linux:yum&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;os:linux:yum&quot;&gt;MariaDB&lt;/a&gt;を参考に、yum Repositoryを設定&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; MariaDB ServerとMariaDB ClientをInstallする&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;yum install MariaDB-server MariaDB-client&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; ここで、CentOS6において、MySQLに依存している幾つかのものが、Replaceされるのと、依存関係で必要なものがInstallされます。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;====================================================================================================
 Package                        Arch            Version                      Repository        Size
====================================================================================================
Installing:
 MariaDB-client                 x86_64          5.5.34-1                     mariadb           10 M
 MariaDB-compat                 x86_64          5.5.34-1                     mariadb          2.7 M
     replacing  mysql-libs.x86_64 5.1.71-1.el6
 MariaDB-server                 x86_64          5.5.34-1                     mariadb           34 M
Installing for dependencies:
 MariaDB-common                 x86_64          5.5.34-1                     mariadb           23 k
 libaio                         x86_64          0.3.107-10.el6               base              21 k
 perl                           x86_64          4:5.10.1-136.el6             base              10 M
 perl-DBI                       x86_64          1.609-4.el6                  base             705 k
 perl-Module-Pluggable          x86_64          1:3.90-136.el6               base              40 k
 perl-Pod-Escapes               x86_64          1:1.04-136.el6               base              32 k
 perl-Pod-Simple                x86_64          1:3.13-136.el6               base             212 k
 perl-libs                      x86_64          4:5.10.1-136.el6             base             578 k
 perl-version                   x86_64          3:0.77-136.el6               base              51 k

Transaction Summary
====================================================================================================
Install      12 Package(s)&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;CentOS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;centos&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;74-2198&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;freebsd&quot;&gt;FreeBSD&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
FreeBSDはportsにmariadbがあるので、それを入れるだけ。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; pkg install mariadb100-server mariadb100-client&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
rc.conf.localに以下を設定
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;&lt;pre class=&quot;code&quot;&gt;mysql_enable=&amp;quot;YES&amp;quot;
mysql_limits=&amp;quot;NO&amp;quot;
mysql_dbdir=&amp;quot;/var/db/mysql&amp;quot;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;FreeBSD&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;freebsd&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;2199-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 19 Nov 2015 03:03:44 +0000</pubDate>
        </item>
    </channel>
</rss>
