如下参数为8.0相关参数以及8.0废弃的部分参数。
身份验证
【参数类型】强制
【说明】由于5.6用户名都采用mysql_native_password认证方式,保证密码加密方式相同,故整个库选用mysql_native_password,也可以在已有用户名上指定认证方式
【配置参考】
default_authentication_plugin = mysql_native_password
字符集
【参考类型】强制
【说明】8.0如果采用utf8mb4,binlog中产生的SET @@session.default_collation_for_utf8mb4=255语句导致5.6从库同步中断至卡住。
必须通过以下参数保证client字符集为utf8
【配置参考】
[client]
default-character-set=utf8
character-set-client-handshake
= FALSE #此处是忽略客户端的字符集,使用服务器的设置
character-set-server=utf8
collation-server
= utf8_unicode_ci
[mysql]
default-character-set=utf8
日志打印时间戳
【参数类型】强制
【说明】使用默认配置,日志打印时间晚8小时
【配置参考】
[mysqld]
log_timestamps=system
区分大小写
【参数类型】强制一致
【说明】8.0起lower-case-table-names配置中值必须和初始化值相同,不指定为0;如果配置中=1则报错
【配置参考】
[mysqld]
lower-case-table-names=1/0
innodb_data_file_path 初始化大小大于12M
binlog_expire_logs_seconds
【参数含义】
可以精确到秒,而此前版本中expire_logs_days的单位为天
持久化修改:set persist binlog_expire_logs_seconds=60*60*24;
参数弃用
MySQL
8.0不在支持query
cache,因此query
cache相关的参数被移除:
query_cache_type
query_cache_size
query_cache_min_res_unit
文件格式相关参数:
innodb_file_format
innodb_file_format_check
innodb_file_format_max
innodb_large_prefix
废弃参数不能再配置,否则无法启动