mysql.ini
# For advice on how to change settings please see
# https://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
# https://dev.mysql.com/doc/refman/8.0/en/windows-create-option-file.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]
#password=your_password
port=3306
socket="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/tmp/mysql.sock"
ssl-ca="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/ca.pem"
ssl-cert="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/client-cert.pem"
ssl-key="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/client-key.pem"
#utf8mb4
#character-set-server=utf8mb4
#collation-server=utf8mb4_unicode_ci
#lower_case_table_names=1
default-character-set=utf8mb4
collation_connection=utf8mb4_unicode_ci
[mysql]
default-character-set=utf8mb4
#这个配置段设置启动MySQL服务的条件;在这种情况下,no-auto-rehash确保这个服务启动得比较快。
no-auto-rehash
connect_timeout=2
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
# Set to the amount of RAM for the most important data cache in MySQL.
# Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size=128M
max_connections=100
table_open_cache=256
tmp_table_size=32M
thread_cache_size=8
innodb_data_home_dir="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/"
# source 导入大量数据时,可将这个数设置为 0:最不安全,效率最高(0、1、2)
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=128M
innodb_buffer_pool_size=128M
innodb_buffer_pool_instances=32
innodb_log_file_size=10M
innodb_thread_concurrency=16
innodb-autoextend-increment=1000
# 修改InnoDB为独立表空间模式:每个数据库的每个表都会生成一个数据空间
innodb_file_per_table=1
join_buffer_size=128M
sort_buffer_size=32M
read_rnd_buffer_size=32M
# MySQL 服务器关闭交互式连接前等待活动的秒数,默认8小时(28800秒)
interactive_timeout=3000
# MySQL 服务器关闭非交互连接之前等待活动的秒数,默认8小时(28800秒)
wait_timeout=3000
max_allowed_packet=32M
explicit-defaults-for-timestamp=true
innodb_lock_wait_timeout=50
innodb_flush_method=normal
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
socket="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/tmp/mysql.sock"
#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64"
#Path to the database root
datadir="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/"
tmpdir="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/tmp/"
log-error="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/mysql_error.log"
# 指定 LOAD_FILE、LOAD DATA、SELECT ... INTO OUTFILE 等报表文件的目录
secure-file-priv="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/tmp/"
open_files_limit=10240
# server_id=.....
#skip-locking
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
init_connect='SET NAMES utf8mb4'
# The default storage engine that will be used when create new tables when MyIASM InnoDB
default-storage-engine=InnoDB
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
#join_buffer_size=128M
#sort_buffer_size=32M
#read_rnd_buffer_size=32M
slow_query_log=ON
slow_query_log_file=mysql-slow.log
long_query_time=2
# 不需要密码验证,直接登录
#skip-grant-tables
# 启用 MySQL SSL 配置 2016-07-28 13:42
ssl-ca="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/ca.pem"
ssl-cert="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/server-cert.pem"
ssl-key="D:/ProgramFiles/MySQL/mysql-commercial-8.0.12-winx64/data/server-key.pem"
bind-address=*
# Installing and Upgrading MySQL (2017-02-25 21:03:34)
# https://dev.mysql.com/doc/refman/5.7/en/installing.html
# 指定时区,不使用 CST(SHOW VARIABLES LIKE '%time_zone%';)2017-10-25 16:44:26
default-time-zone='+08:00'
# 使日志时间与系统时间一致(SHOW GLOBAL VARIABLES LIKE 'log_timestamps';) 2018-08-14 17:51:03
log_timestamps=SYSTEM
[mysqld-8.0]
#sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO
sql_mode=TRADITIONAl
# For advice on how to change s