# mysqld --version
mysqld Ver 10.0.16-MariaDB-1 for debian-linux-gnu on x86_64 ((Debian))
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.0.16-MariaDB-1 (Debian)
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
# MariaDB-specific config file.# Read by /etc/mysql/my.cnf[client]# Default is Latin1, if you need UTF-8 set this (also in server section)#default-character-set = utf8default-character-set = utf8mb4
[mysqld]## * Character sets#-# Default is Latin1, if you need UTF-8 set all this (also in client section)#character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
sql_mode= NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
skip-character-set-client-handshake
# ==== Bufferkey_buffer_size= 8M
read_buffer_size= 1M
read_rnd_buffer_size= 1M
sort_buffer_size= 2M
join_buffer_size= 256K
query_cache_limit= 8M
query_cache_size= 64M
# ==== Binary Loglog_bin= mysql-bin # データインポート時はコメントアウトbinlog_format= MIXED
# ==== Connectionmax_connections= 50
max_connect_errors= 50
wait_timeout=300# 600interactive_timeout= 600
connect_timeout= 10
# ==== InnoDBinnodb_data_file_path= ibdata1:1G
innodb_file_per_table
innodb_buffer_pool_size= 512M
innodb_additional_mem_pool_size= 20M
innodb_write_io_threads= 8
innodb_read_io_threads= 8
innodb_log_buffer_size= 8M # 通常時:8程度, データインポート時:32度innodb_log_files_in_group= 2
innodb_log_file_size= 128M
innodb_flush_log_at_trx_commit=1# 通常時:1(デフォルト), データインポート時:2 or 0#skip_innodb_doublewrite # ダブルライトバッファへの書き込みをスキップ(通常時は指定しない。データインポート時のみ)# ==== Loglog-error = /var/log/mysql/error.log
#general_log_file = /var/log/mysql/mysql.log # デバッグ時に有効化#general_log = 1 # デバッグ時に有効化#slow_query_log_file = /var/log/mysql/slow.log # デバッグ時に有効化#slow_query_log = 1 # デバッグ時に有効化# ==== Event Schedulerevent-scheduler = 1
[mysql]no-auto-rehash
[mysqlhotcopy]interactive-timeout
【注意】
設定ファイルは複数持つことが可能であり、読み込み順とスコープは以下のようになっている。(MariaDB 10.0.13 以上の deb パッケージインストールの場合(参照))
同じ項目の場合、後から読み込んだ設定の方が有効になる。
12345
/etc/my.cnf => Global
/etc/mysql/my.cnf => Global
$MYSQL_HOME/my.cnf => Server
defaults-extra-file => File specified with --defaults-extra-file=path, if any
~/.my.cnf => User