记得给权限呀, 权限呀, 都是泪
多实例
单实例
配置文件
[client]port = 3301socket = /data/mysql3301/data/mysqld3301.sock[mysqld_safe]socket = /data/mysql3301/data/mysqld3301.socknice = 0#flush-cachesnuma-interleave[mysql]port = 3301socket = /data/mysql3301/data/mysqld3301.sockno_auto_rehashdefault_character_set = utf8prompt = \u@\h:\p:[\d]>[mysqldump]quickquote-namesmax_allowed_packet = 16M[mysqld]# GENERAL #user = mysqldbport = 3301default_storage_engine = InnoDBsocket = /data/mysql3301/data/mysqld3301.sockpid_file = /data/mysql3301/data/mysqld3301.pidserver-id = 6501# Charset #init_connect = 'SET collation_connection = utf8mb4_unicode_ci'init_connect = 'SET NAMES utf8mb4'character-set-server = utf8mb4character-set-client = utf8mb4collation-server = utf8mb4_unicode_ciskip-character-set-client-handshakeexplicit_defaults_for_timestamp=true# MyISAM #key_buffer_size = 32Mmyisam_recover = FORCE,BACKUP# SAFETY #max_allowed_packet = 16Mmax_connect_errors = 1000000skip_name_resolveinnodb = FORCE# DATA STORAGE #datadir = /data/mysql3301/data# BINARY LOGGING #log_bin = /data/mysql3301/binlog/mysql-binlog_bin_index = /data/mysql3301/binlog/mysql-bin.indexexpire_logs_days = 7sync_binlog = 1binlog_format = ROWbinlog_cache_size = 4Mmax_binlog_size = 1G max_binlog_cache_size = 100M# CACHES AND LIMITS #tmp_table_size = 32Mmax_heap_table_size = 32Mquery_cache_type = 0query_cache_size = 0max_connections = 5000max_user_connections = 5000thread_cache_size = 100open_files_limit = 65536table_definition_cache = 10240table_open_cache = 10240thread_handling = pool-of-threadsthread_pool_oversubscribe = 10# INNODB #innodb_flush_method = O_DIRECTinnodb_log_files_in_group = 2innodb_log_file_size = 512Minnodb_log_buffer_size = 64Minnodb_flush_log_at_trx_commit = 2innodb_file_per_table = 1innodb_open_files = 1024innodb_buffer_pool_size = 1#innodb_buffer_pool_populate = 1innodb_additional_mem_pool_size = 32Minnodb_print_all_deadlocks = 1innodb_log_group_home_dir = /data/mysql3301/innologinnodb_data_home_dir = /data/mysql3301/innodata# REPLICATION #skip_slave_start = 1#replicate-wild-ignore-table = mysql.%replicate-wild-ignore-table = information_schema.%replicate-wild-ignore-table = performance_schema.%relay_log = /data/mysql3301/relaylog/relay-binrelay-log-index = /data/mysql3301/relaylog/relay-bin.indexsync_master_info = 1sync_relay_log = 1sync_relay_log_info = 1read_only = 0# LOGGING #log_error = /data/mysql3301/log/mysql-error.loglog_queries_not_using_indexes = 1long_query_time = 1slow_query_log = 1slow_query_log_file = /data/mysql3301/log/mysql-slow.loggeneral_log = OFFgeneral_log_file = /data/mysql3301/log/mysql-general.log