mysql配置文件my.cnf
mysql配置文件如下:
[mysqld]
character-set-server=utf8mb4
#skip-grant-tables
log-bin=mysql-bin
binlog-format=ROW
binlog-ignore-db=mysql
server-id=1
user=mysql
port=3306
basedir=/var/log/mysql
datadir=/home/mysql_data
socket=/var/log/mysql/mysql.sock
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
lower_case_table_names=1
transaction_isolation=READ-COMMITTED
max_connections=2000
max_connect_errors=2000
innodb_buffer_pool_size=12GB #70% RAM
innodb_file_per_table=1
innodb_log_file_size=500M
innodb_log_buffer_size=500M
innodb_flush_log_at_trx_commit=1
innodb_print_all_deadlocks=1
innodb_flush_method=O_DIRECT
innodb_read_io_threads=8
innodb_write_io_threads=8
innodb_io_capacity=5000
innodb_io_capacity_max=20000
innodb_lock_wait_timeout=20000
innodb_large_prefix=on
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
|