まとまりのないブログ

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

ssdでデータベースサーバを構築してみた

現状ではまだ手を出すのは早いかもしれないssdでデータベースサーバを構築してみた。実験的な意味で。

no image

failure:Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

failure:Cannot create PoolableConnectionFactory (Could not create connection to database server. Att …

no image

Table 'テーブル' is marked as crashed and should be repaired

データベースへ接続してsqlを実行したときに Table ‘テーブル’ is marked as crashed and should be repaired というエラーが返ってきた。エラーの内容は …

no image

myisamchk: error: myisam_sort_buffer_size is too small

myisamchkを実行したときに myisamchk: error: myisam_sort_buffer_size is too small Try fixing it by using the …

no image

sennaのインストール

かなり嵌ったので備忘録。sennaをインストールする際、configureのオプションを指定しないと、デフォルトの文字コードはeuc-jpでconfigureをすることになる。mecabで文字コードを …