
[client] port=3306 socket=/data/tmp/mysql.sock default-character-set=utf8mb4 [mysqld] port=3306 socket=/data/tmp/mysql.sock basedir=/mysql/mysql_8022 datadir=/data/data character-set-server=utf8mb4 default_storage_engine=INNODB #表名不区分大小写 lower_case_table_names=1 innodb_buffer_pool_size=12025908428 --建议是物理内存的50%-80% 可以70% #最大执行sql长度大小 max_allowed_packet=33554432 innodb_log_file_size=1073741824 innodb_log_files_in_group=5 innodb_flush_neighbors=0 innodb_open_files=10000 --innodb_undo_tablespaces=3 --新加的 innodb_log_buffer_size=16777216 innodb_thread_concurrency=40 --大于等于CPU的核数,小于CPU核数两倍 innodb_strict_mode=1 --死锁也记录到err.log中 innodb_write_io_threads=12 --CPU核数一半 innodb_read_io_threads=12 --CPU核数一半 innodb_file_per_table=1 innodb_buffer_pool_dump_pct=40 --关数据库的时候将40%热区记录下来 innodb_page_cleaners=2 --刷脏数据页 默认是1 log_timestamps=system --按系统时间记录日志 explicit_defaults_for_timestamp=1 min_examined_row_limit=100 --查询小于100条的没必要记录在 binlog_rows_query_log_events=1 log_bin_trust_function_creators=1 # 允许最大连接数 max_connections=10000 general_log=0 general_log_file=/data/log/general.err_ long_query_time=5 # log settings log_error=/data/log/error.log log-bin=mysql-bin slow_query_log=1 --慢查询日志打开 slow_query_log_file =/data/log/slow_query.log log_queries_not_using_indexes=1 --记录没有使用索引的QUERIES log_throttle_queries_not_using_indexes=10 --记录10个 log_slow_admin_statements=1 --记录管理性的log default-authentication-plugin=mysql_native_password tmpdir=/data/tmp pid-file=/data/log/mysql.pid innodb_strict_mode=0 group_concat_max_len=104857600 binlog_expire_logs_seconds=864000 --和上面对应一致10天 open_files_limit=65534 thread_cache_size=50 table_open_cache=27762