まとまりのないブログ

something which something is something

mysql

mysqlのmy.iniの標準値のメモ

投稿日:

mysqlのmy.iniファイルのサンプルの設定ファイルの値がどのように設定されているかチェック。mysqldの設定例を抜き出してみる。設定するときの参考にはなるだろうと思うので。

my-small.cnf

This is for a system with little memory (<= 64M) where MySQL is only used from time to time and it's important that the mysqld daemon doesn't use much resources. [mysqld] port = 3306 socket = /tmp/mysql.sock skip-locking key_buffer = 16K max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K

my-medium.cnf

This is for a system with little memory (32M – 64M) where MySQL plays
an important part, or systems up to 128M where MySQL is used together with
other programs (such as a web server)
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

my-large.cnf

This is for a large system with memory = 512M where the system runs mainly MySQL.
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8

my-huge.cnf

This is for a large system with memory of 1G-2G where the system runs mainly
MySQL.

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_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
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8

そして、各設定数値に違いがあるものをさらに抜き出してみる。

my-small my-medium my-large my-huge
key_buffer 16K 16M 256M 384M
max_allowed_packet 1M 1M 1M 1M
table_cache 4 64 256 512
sort_buffer_size 64K 512K 1M 2M
read_buffer_size 256K 256K 1M 2M
read_rnd_buffer_size 256K 512K 4M 8M
net_buffer_length 2K 8K
myisam_sort_buffer_size 8M 64M 64M
thread_stack 64K
thread_cache_size 8 8
query_cache_size 16M 32M
thread_concurrency 8 8

-mysql

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)

関連記事

no image

Incorrect key file for table ‘./my/table.MYI’; try to repair it

MySQLのテーブルが壊れた。Incorrect keyとかCorruptとかエラーメッセージが出たのでrepairテーブルとかmyisamchkとか色々修復するべく試したがどうやっても直ってくれない …

no image

HAPROXYを使ってmysqlサーバーの負荷分散

備忘録 listen mysql-db bind *:3306 mode tcp option mysql-check user haproxy1 balance roundrobin server …

no image

mysqlのテーブルから不要なインデックスを削除する

テーブルを設計し直すために不要なインデックスを削除してみることにする。 mysql> drop index idx1 on ac200902; Query OK, 49398993 rows affe …

no image

UbuntuのMySQLの起動と停止

UbuntuにMySQLをソースから/usr/local/mysqlにインストールした場合。

no image

mysqlのデータベースのテーブルから不要なフィールド(列)を削除

テーブルを再設計するために不要なフィールドを削除してみる。たしか前にフィールドを削除したときは、フィールドにインデックスが作成されている場合はフィールド削除の前にインデックスを削除しておかないとエラー …