[client] port = 3306 socket = /tmp/mysql.sock character-sets-dir = /usr/local/mysql5722/share/charsets default-character-set=utf8mb4 [mysql] port = 3306 socket = /tmp/mysql.sock prompt="\u@mysql216 \R:\m:\s [\d]> " no-auto-rehash character-sets-dir = /usr/local/mysql5722/share/charsets default-character-set = utf8mb4 [mysqld_safe] user = mysql port = 3306 basedir = /usr/local/mysql5722 datadir = /data/mysql socket = /tmp/mysql.sock pid-file = /data/mysql/my3306.pid log-error = /log/mysql/my3306.err malloc-lib = /usr/lib64/libjemalloc.so character-sets-dir = /usr/local/mysql5722/share/charsets default-character-set = utf8mb4 [mysqld] user = mysql port = 3306 server-id = 2163306 basedir = /usr/local/mysql5722 datadir = /data/mysql socket = /tmp/mysql.sock log-error = /log/mysql/my3306.err pid-file = /data/mysql/mysql3306.pid lc_messages_dir = /usr/local/mysql5722/share/english lc_messages = en_US skip_name_resolve = 1 character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4' open_files_limit = 65535 external-locking = FALSE explicit_defaults_for_timestamp = 1 myisam_repair_threads = 1 max_allowed_packet = 512M # -- Lee 20180611 report_host = 10.25.151.216 report_port = 3306 net_buffer_length = 16384 transaction_isolation = READ-COMMITTED # added from 5.7.20 RC reduce deadlock disabled_storage_engines = "MyISAM,BLACKHOLE,FEDERATED,ARCHIVE" # >=5.7.8 innodb_numa_interleave = ON # added from 5.7.20, reduce NUMA swap # Connections max_connections = 500 max_connect_errors = 1000000 back_log = 1024 interactive_timeout = 600 wait_timeout = 600 # Table open cache table_open_cache = 2000 table_definition_cache = 2000 table_open_cache_instances = 64 # Memory ## Global shared key_buffer_size = 4M tmp_table_size = 64M max_heap_table_size = 64M innodb_log_buffer_size = 32M ## Per connection read_buffer_size = 2M read_rnd_buffer_size = 2M sort_buffer_size = 2M join_buffer_size = 2M binlog_cache_size = 4M ## Others myisam_sort_buffer_size = 4M myisam_max_sort_file_size = 10G bulk_insert_buffer_size = 32M ## Query cache OFF query_cache_size = 0 query_cache_type = 0 ## Threads thread_stack = 512K thread_cache_size = 500 # -- Lee 20180611 # Slow query log slow_query_log = 1 slow_query_log_file = /log/mysql/slow3306.log long_query_time = 1 # Binary log log-bin = /log/mysql/binary/mysql-bin log-bin-index = /log/mysql/binary/mysql-bin.index binlog_format = ROW sync_binlog = 0 max_binlog_cache_size = 2G max_binlog_size = 2G expire_logs_days = 7 # Relay log relay-log = /log/mysql/relay/slave-relay-bin relay-log-index = /log/mysql/relay/slave-relay-bin.index relay_log_recovery = 1 relay-log-purge = 1 # Replication gtid_mode = on enforce_gtid_consistency = 1 log_slave_updates = 1 master_info_repository = TABLE relay_log_info_repository = TABLE sync-master-info = 1 read_only = 1 slave-parallel-workers = 4 slave_parallel_type = LOGICAL_CLOCK # >=5.7.2 #slave_preserve_commit_order = ON # >=5.7.5 must set slave_parallel_type # Password Plugin -- Lee 0531 plugin-load-add = validate_password.so validate-password = FORCE_PLUS_PERMANENT validate_password_length = 10 validate_password_policy = STRONG # InnoDB innodb_data_file_path = ibdata1:1G:autoextend # InnoDB buffer innodb_buffer_pool_size = 32G innodb_buffer_pool_instances = 8 innodb_buffer_pool_load_at_startup = 1 innodb_buffer_pool_dump_at_shutdown = 1 # Innodb log innodb_log_group_home_dir = /log/mysql/iblog innodb_log_file_size = 2G innodb_log_files_in_group = 4 innodb_max_undo_log_size = 4G innodb_flush_log_at_trx_commit = 0 # InnoDB IO # 根据您的服务器IOPS能力适当调整 # 配置高端PCIe SSD卡的话,则可以调整的更高,比如 50000 - 80000 innodb_file_per_table = 1 innodb_io_capacity = 1000 innodb_io_capacity_max = 2000 innodb_flush_neighbors = 0 innodb_thread_concurrency = 4 innodb_write_io_threads = 8 innodb_read_io_threads = 8 innodb_purge_threads = 4 innodb_page_cleaners = 4 innodb_open_files = 65535 innodb_max_dirty_pages_pct = 60 innodb_flush_method = O_DIRECT innodb_lru_scan_depth = 2000 innodb_checksums = 1 innodb_checksum_algorithm = crc32 innodb_lock_wait_timeout = 30 innodb_rollback_on_timeout = 1 innodb_print_all_deadlocks = 1 innodb_online_alter_log_max_size = 4G internal_tmp_disk_storage_engine = InnoDB innodb_sync_spin_loops = 100 innodb_spin_wait_delay = 30 innodb_file_format = Barracuda innodb_file_format_max = Barracuda # InnoDB monitor innodb_monitor_enable = all innodb_stats_on_metadata = 0 innodb_status_file = 1 innodb_status_output_locks = 0 #performance_schema performance_schema = ON performance_schema_max_table_instances = 100 performance-schema-instrument = 'memory/%=ON' # added --20180719 [mysqldump] quick max_allowed_packet = 512M