MySQL Server 5.1 config - plembo/onemoretech GitHub Wiki

MySQL Server 5.1 Configuration

MySQL Server 5.1 shipped with Red Hat Enterprise 6, and given the numbers of both RHEL and CentOS 6 servers deployed, is still an important release for support purposes.

My.cnf

The main configuration file for v5.1 is /etc/my.cnf, later versions of MariaDB as shipping in RHEL 7 use this to point to conf files under /etc/my.cnf.d.

This is a sample my.cnf adapted from mysql-huge.cnf, designed to run on a server with from 1 - 4 GB RAM available for the database server. For a master server uncomment the bin log line. For a slave also uncomment the relay log line and change the server-id to 2 (or if a second slave, to 3, and so on).

[mysqld]
datadir=/data/app/mysql/var
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0

# For debugging
log-error=/data/logs/mysql/mysqld.log

# For Replication
server-id=1
# log-bin=/data/app/mysql/var/mysql-bin
# relay-log = /data/app/mysql/var/mysqld-relay-bin

# For performance
skip-external-locking=1
key_buffer_size=384M
max_allowed_packet=1M
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=64M
thread_concurrency=8
innodb_file_per_table=1
innodb_flush_method=O_DIRECT
innodb_buffer_pool_size=384M
innodb_additional_mem_pool_size=20M
innodb_log_file_size=100M
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=50
slow_query_log=1
slow_query_log_file=/data/logs/mysql/mysqld_slow.log
back_log=150
open_files_limit=65535
max_connections=350
tmp_table_size=128M
max_heap_table_size=128M
table_open_cache=4K

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqld_safe]
open_files_limit=65535
log-error=/data/logs/mysql/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Copyright 2004-2019 Phil Lembo

⚠️ **GitHub.com Fallback** ⚠️