Skip to content

Instantly share code, notes, and snippets.

@bageljp
Created November 26, 2012 09:45
Show Gist options
  • Save bageljp/bce3b4d5e58532883524 to your computer and use it in GitHub Desktop.
Save bageljp/bce3b4d5e58532883524 to your computer and use it in GitHub Desktop.
mysqld configuration by amazonlinux
/var/log/mysqld.log /var/lib/mysqld/*log {
daily
rotate 31
dateext
missingok
postrotate
# just if mysqld is really running
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin -u <user> -p<password> ping &>/dev/null
then
/usr/bin/mysqladmin -u <user> -p<password> flush-logs
fi
endscript
}
[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8mb4
max_connections = 200
general-log = 0
general-log-file = query.log
slow_query_log
long_query_time = 1
slow_query_log_file = slow.log
log_queries_not_using_indexes
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:100M:autoextend
innodb_buffer_pool_size = 1024M
innodb_log_file_size = 64M
innodb_file_per_table = 1
server-id = 1
expire_logs_days = 7
auto_increment_offset = 1
auto_increment_increment = 4
log-bin = mysql-bin
binlog_format = MIXED
#log_slave_updates
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_master_timeout = 1000
#rpl_semi_sync_slave_enabled = 1
#plugin-load=rpl_semi_sync_master=semisync_master.so
#plugin-load=rpl_semi_sync_slave=semisync_slave.so
#ssl-ca=/etc/ssl/mysql/mysql-ca.crt
#ssl-cert=/etc/ssl/mysql/mysql-server.crt
#ssl-key=/etc/ssl/mysql/mysql-server.key
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqldump]
default-character-set = utf8mb4
[mysql]
default-character-set=utf8mb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment