8.0 New Feature
(1)授权表现在均为InnoDB
不会再发生一部分成功,一部分失败的情况,要么全成功,要么全部回滚。
Incompatible Change: The grant tables in the mysql system database are now InnoDB (transactional) tables.
Previously, these were MyISAM (nontransactional) tables.
This change applies to these tables: user, db, tables_priv, columns_priv, procs_priv, proxies_priv
Previously, an account-management statement that named multiple users could succeed for some users and fail for others.
Now, each statement is transactional and either succeeds for all named users or rolls back and has no effect if any error occurs.
The statement is written to the binary log if it succeeds, but not if it fails; in that case, rollback occurs and no changes are made
(2)MySQL开始支持role角色
MySQL now supports roles
(3)参数变化
expire-logs-days # 已经废弃,binlog_expire_logs_seconds取代,默认为30天
innodb_undo_tablespaces # 已经废弃,innodb总会创建2个undo表空间,需要增加,使用CREATE UNDO TABLESPACE
internal_tmp_disk_storage_engine # 已经废弃,8.0.16开始内部磁盘临时表默认均为InnoDB存储引擎。
character-set-server=utf8 #现在该参数utf8为utf8mb3别名,以后将改为utf8mb4
innodb_read_only # 原来只对InnoDB表生效,无法creating dropping,现在对所有表生效。
--log-tc-size #The hardcoded memory page size of 8KB for the memory-mapped
# transaction coordinator was too small for platforms such as
# ARM64 and PowerPC where the page size is much larger.
# 现在默认为内存页的6倍。
validate_password_check_user_name # 现在默认打开
validate_password # 默认打开,会拒绝与当前用户名相同的密码。
innodb_deadlock_detect # 可以禁止死锁检测,防止多线程等待同一个锁引发处理缓慢,可以通过设置 innodb_lock_wait_timeout
innodb_checksum_algorithm # 在5.6.3中取代了参数innodb_checksums
innodb_flush_method # 现在默认值Unix为fsync,windows为unbuffered
innodb_support_xa # 被移除, 默认支持两阶段提交
(4)mysql设置参数新引入SET PERSIST
SET PERSIST # SET引入设置可以动态global参数的同时会将参数持久化到data目录下的mysqld-auto.cnf文件,服务器启动会加载。
performance_schema.variables_info # 可以显示最近修改的参数以及源。
(5)物理文件变化
INFORMATION_SCHEMA.TABLES VERSION:.frm .trg .trn文件将不存在,取而代之的均为数据字典,version字段写死为10,这是最后一个
支持.frm的版本MySQL 5.7的版本号。
(6)mysql_install_db已经被移出
mysql_install_db:已经被移除,初始化数据库必须使用mysqld --initialize or --initialize-insecure
(7)引入ibd2sdi新命令行
ibd2sdi:新引入命令行工具,used to extract serialized dictionary information (SDI) from persistent InnoDB tablespaces
(8)支持Hint MERGE NO_MERGE
优化器现在支持表级别的hint:MERGE and NO_MERGE
SELECT /*+ MERGE(dt) */ * FROM (SELECT * FROM t1) AS dt;
SELECT /*+ NO_MERGE(dt) */ * FROM (SELECT * FROM t1) AS dt;
(9)支持invisible index
现在支持invisible index,优化器不会选择使用索引,但是会正常维护索引,可以测试移除索引造成影响,又不破坏现有结构。
(10)performance_schema加强
现在performance_schema会收集服务器错误:events_errors_summary_global_by_error,
events_errors_summary_by_account_by_error,
events_errors_summary_by_host_by_error,
events_errors_summary_by_thread_by_error,
events_errors_summary_by_user_by_error
performance_schema_error_size:控制收集错误数量。
(11)InnoDB引擎
--分区变化
通用分区处理器被移除,MySQL 8.0 InnoDB为唯一支持分区处理的存储引擎,
移除分区可以用ALTER TABLE ... REMOVE PARTITIONING
升级之前,需要把非InnoDB存储引擎分区表使用ALTER TABLE ... ENGINE=INNODB转换为InnoDB
--InnoDB文件变化
InnoDB:当在Data directory外建立表空间时,InnoDB不在创建.isl InnoDB动态链接文件,
所以不再支持服务器离线时,修改.isl移动远程表空间操作,利用redo log定位远程日志文件。
InnoDB:不再支持压缩临时表,当row_format=compressed时,innodb_strict_mode为true(default),create temporary table将报错
(12)新引入数据字典表
INFORMATION_SCHEMA.INNODB_CACHED_INDEXES:显示索引缓存在内存中的页数量。
(13)AUTO_INCREMENT加强
现在将AUTO_INCREMENT值写入Redo log,写入存储引擎系统表,将自增最大值持久化,设置AUTO_INCREMENT=N不在不生效,
手工update AUTO_INCREMENT 列也生效。
(14)5.7与8.0升降级说明
(1)To upgrade to MySQL 8.0 from MySQL 5.7, you must perform the upgrade procedure described at Upgrading MySQL.
(2)Downgrading from MySQL 8.0 to MySQL 5.7 is only supported using the logical downgrade method (a mysqldump downgrade).
In-place downgrades are not supported.
参考:
MySQL 8.0 Reference Manual