Skip to content

Instantly share code, notes, and snippets.

@jackiewu
Created May 19, 2020 02:43
Show Gist options
  • Save jackiewu/97e3f475098db898c0ec2e8278ecfcfe to your computer and use it in GitHub Desktop.
Save jackiewu/97e3f475098db898c0ec2e8278ecfcfe to your computer and use it in GitHub Desktop.
my my.cnf
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
port = 3306
server_id = 123456
datadir = /var/lib/mysql
tmpdir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
log-error = /var/lib/mysql/hostname.err
pid-file = /var/lib/mysql/hostname.pid
log_bin
sync_binlog = 1
binlog_format = row
expire_logs_days = 7
binlog_rows_query_log_events = ON
log_slave_updates = OFF
skip_name_resolve
skip-character-set-client-handshake
log_timestamps = SYSTEM
character_set_server = utf8mb4
default-authentication-plugin = mysql_native_password
max_connections = 1024
max_user_connections = 1000
thread_cache_size = 512
table_open_cache = 4096
tmp_table_size = 256M
max_heap_table_size = 256M
max_allowed_packet = 64M
back_log = 4096
open_files_limit = 65535
slave_net_timeout = 60
userstat = ON
slow_query_log = ON
long_query_time = 1
log_slow_verbosity = full
#innodb setting
innodb_file_per_table
innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:100M:autoextend
innodb_buffer_pool_size = 1G
innodb_log_files_in_group = 2
innodb_log_file_size = 128M
innodb_log_buffer_size = 8M
innodb_doublewrite = 1
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_stats_on_metadata = OFF
[mysqldump]
quick
[mysql]
no-auto-rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment