温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

MySQL 8.0.20的新特性有哪些

发布时间:2021-11-01 09:32:59 来源:亿速云 阅读:234 作者:iii 栏目:MySQL数据库

这篇文章主要介绍“MySQL 8.0.20的新特性有哪些”,在日常操作中,相信很多人在MySQL 8.0.20的新特性有哪些问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”MySQL 8.0.20的新特性有哪些”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

(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 列也生效。

到此,关于“MySQL 8.0.20的新特性有哪些”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI