5.6
my.cnf
[mysqld]
port=3306
basedir=/home/MysqlServer/mysql
datadir=/home/MysqlServer/mysql/data
socket=/tmp/mysql.sock
user=mysql
tmpdir=/tmp
bind-address = 0.0.0.0
max_connections=200
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
default-storage-engine=INNODB
innodb_buffer_pool_size=64MB
max_allowed_packet=16M
skip-name-resolve
lower_case_table_names=1
sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
[mysqld_safe]
log-error=/home/MysqlServer/mysql/data/error.log
pid-file=/home/MysqlServer/mysql/data/mysql.pid
[mysql]
default-character-set=utf8mb4
[client]
socket=/tmp/mysql.sock
default-character-set=utf8mb4
my.ini
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
port =3306
[mysqld]
innodb_buffer_pool_size=1G
server_id=1
character-set-server=utf8
basedir ="E:\\bft70\\mysql57\\mysql-5.7.20-winx64"
datadir ="E:\\bft70\\mysql57\\mysql-5.7.20-winx64\\data"
##timestamp 字段不声明插入,告警
explicit_defaults_for_timestamp=true
max_connections=200
join_buffer_size=512m
sort_buffer_size=88M
read_rnd_buffer_size=8M
5.7.20
my.ini
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
port =3306
[mysqld]
innodb_buffer_pool_size=1G
server_id=1
character-set-server=utf8
basedir ="E:\\bft70\\mysql57\\mysql-5.7.20-winx64"
datadir ="E:\\bft70\\mysql57\\mysql-5.7.20-winx64\\data"
##timestamp 字段不声明插入,告警
explicit_defaults_for_timestamp=true
max_connections=200
join_buffer_size=512m
sort_buffer_size=88M
read_rnd_buffer_size=8M
my.cnf
[client]
#password = your_password
port = 3306
socket = /home/mysql/data/home-mysql.sock
# The MySQL server
[mysqld]
port = 3306
socket = /home/mysql/data/home-mysql.sock
datadir = /home/mysql/data/
basedir = /home/mysql/mysql/
log_error = /home/mysql/data/home-error.log
#pid-file = /tmp/home-mysql.pid
pid-file = /home/mysql/data/home-mysql.pid
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
skip-external-locking
skip-name-resolve
key_buffer_size = 384M
#max_allowed_packet = 16M
max_allowed_packet = 24M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 128
query_cache_size =0
expire_logs_days =10
log_bin_trust_function_creators=1
#slave-skip-errors = 1062,1053
# Try number of CPU's*2 for thread_concurrency
#thread_concurrency = 8
#log_slow_queries
slow-query-log
long_query_time =20
open_files_limit = 65535
event_scheduler=1
skip-host-cache
skip-name-resolve
max_connections = 3000
tmp_table_size = 256M
max_heap_table_size = 256M
net_read_timeout = 60
connect_timeout = 60
wait_timeout=31536000
# Replication Master Server (default)
# binary logging is required for replication
binlog_format=mixed
log-bin=mysql-bin
#log-slave-updates
#replicate-ignore-table = CTS_GUOJIA.TAB_OMIN_CTS_DI_1
binlog_cache_size = 2M
binlog_stmt_cache_size = 2M
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
#replicate-do-db = CTS_DB
#innodb
innodb_buffer_pool_instances = 4
innodb_buffer_pool_size= 50G
innodb_log_buffer_size= 16M
innodb_log_file_size= 512M
#innodb_log_files_in_group = 3
innodb_write_io_threads= 8
innodb_read_io_threads= 8
innodb_file_per_table= 1
innodb_flush_log_at_trx_commit= 2
innodb_support_xa = 0
#innodb_change_buffering = insert
#innodb_flush_method = O_DIRECT
#innodb_doublewrite = off
#innodb_file_format = Barracuda #for compression
#innodb_max_purge_lag
#
[mysqldump]
quick
#max_allowed_packet = 16M
max_allowed_packet = 100M
[mysql]
no-auto-rehash