MySQL 8.0.20的新特性有哪些

53次阅读
没有评论

共计 3598 个字符,预计需要花费 9 分钟才能阅读完成。

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

(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 的新特性有哪些”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-27发表,共计3598字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)