MySQL8.0
版本比之5.7
做了很大的变化, 比较明显的主要有去掉了查询缓存, 密码验证方式变更, 默认编码变更等方面, 部分特性随着 8.0 最新版的发布也会存在小幅度的改变, 更多变化可以参考what-is-new-in-mysql8.0
了解更多. 如果是从5.7
升级到8.0
可以参考upgrading-from-previous-series.html
了解更多的不同. 下面则主要介绍 MySQL 常用特性的一些变化.
常用参数变更
弃用以下参数:
# variables
innodb_stats_sample_pages
innodb_locks_unsafe_for_binlog
innodb_file_format
innodb_file_format_check
innodb_file_format_max
innodb_large_prefix
ignore_builtin_innodb
skip-symbolic-links # 默认即 skip-symbolic-links.
sync_frm # 8.0 版本去掉了 .frm 文件, 内置在 ibd 文件中
sql_log_bin # 仅支持会话级别设置
query_cache_xxx # 缓存相关的系统变量
metadata_locks_cache_size
metadata_locks_hash_instances
date_format
datetime_format
time_format
max_tmp_tables
# status
Qcache_xxx_xxxx # 缓存相关的状态参数
备注:8.0 版本废弃了 query cache 特性
参数变更:
expire-logs-days => binlog_expire_logs_seconds # 替换 expire-logs-days
tx_isolation => transaction_isolation
tx_read_only => transaction_read_only
innodb_undo_logs => innodb_rollback_segments
have_query_cache = no # 永远为 NO
information_schema 变更
INNODB_LOCKS => data_locks
INNODB_LOCK_WAITS => data_lock_waits
X-plugin
X plugin
主要用于增强MySQL document
的特性, 在 5.7 中为可选项, 需要单独安装插件, 在 8.0 中已经是默认开启, 可以设置xplugin=off
禁用.
更多见:
binlog 相关
binlog 过期设置