溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

MySQL 8.0.20的新特性有哪些

發(fā)布時(shí)間:2021-11-01 09:32:59 來源:億速云 閱讀:245 作者:iii 欄目:MySQL數(shù)據(jù)庫

這篇文章主要介紹“MySQL 8.0.20的新特性有哪些”,在日常操作中,相信很多人在MySQL 8.0.20的新特性有哪些問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”MySQL 8.0.20的新特性有哪些”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

(1)授權(quán)表現(xiàn)在均為InnoDB

不會(huì)再發(fā)生一部分成功,一部分失敗的情況,要么全成功,要么全部回滾。 

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)參數(shù)變化

expire-logs-days                             # 已經(jīng)廢棄,binlog_expire_logs_seconds取代,默認(rèn)為30天

innodb_undo_tablespaces              # 已經(jīng)廢棄,innodb總會(huì)創(chuàng)建2個(gè)undo表空間,需要增加,使用CREATE UNDO TABLESPACE

internal_tmp_disk_storage_engine # 已經(jīng)廢棄,8.0.16開始內(nèi)部磁盤臨時(shí)表默認(rèn)均為InnoDB存儲(chǔ)引擎。

character-set-server=utf8              #現(xiàn)在該參數(shù)utf8為utf8mb3別名,以后將改為utf8mb4

innodb_read_only                           # 原來只對InnoDB表生效,無法creating dropping,現(xiàn)在對所有表生效。

 --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.

                                                        # 現(xiàn)在默認(rèn)為內(nèi)存頁的6倍。

validate_password_check_user_name  # 現(xiàn)在默認(rèn)打開  

validate_password                               # 默認(rèn)打開,會(huì)拒絕與當(dāng)前用戶名相同的密碼。

innodb_deadlock_detect                     # 可以禁止死鎖檢測,防止多線程等待同一個(gè)鎖引發(fā)處理緩慢,可以通過設(shè)置 innodb_lock_wait_timeout

innodb_checksum_algorithm             # 在5.6.3中取代了參數(shù)innodb_checksums

 innodb_flush_method                        # 現(xiàn)在默認(rèn)值Unix為fsync,windows為unbuffered

innodb_support_xa                            # 被移除, 默認(rèn)支持兩階段提交

(4)mysql設(shè)置參數(shù)新引入SET PERSIST

SET PERSIST                                     # SET引入設(shè)置可以動(dòng)態(tài)global參數(shù)的同時(shí)會(huì)將參數(shù)持久化到data目錄下的mysqld-auto.cnf文件,服務(wù)器啟動(dòng)會(huì)加載。

performance_schema.variables_info # 可以顯示最近修改的參數(shù)以及源。

(5)物理文件變化

INFORMATION_SCHEMA.TABLES VERSION:.frm .trg .trn文件將不存在,取而代之的均為數(shù)據(jù)字典,version字段寫死為10,這是最后一個(gè)

                                    支持.frm的版本MySQL 5.7的版本號(hào)。

(6)mysql_install_db已經(jīng)被移出

mysql_install_db:已經(jīng)被移除,初始化數(shù)據(jù)庫必須使用mysqld --initialize or --initialize-insecure 

(7)引入ibd2sdi新命令行

ibd2sdi:新引入命令行工具,used to extract serialized dictionary information (SDI) from persistent InnoDB tablespaces

(8)支持Hint MERGE NO_MERGE

優(yōu)化器現(xiàn)在支持表級別的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

現(xiàn)在支持invisible index,優(yōu)化器不會(huì)選擇使用索引,但是會(huì)正常維護(hù)索引,可以測試移除索引造成影響,又不破壞現(xiàn)有結(jié)構(gòu)。

(10)performance_schema加強(qiáng)

現(xiàn)在performance_schema會(huì)收集服務(wù)器錯(cuò)誤: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:控制收集錯(cuò)誤數(shù)量。

(11)InnoDB引擎

--分區(qū)變化

通用分區(qū)處理器被移除,MySQL 8.0 InnoDB為唯一支持分區(qū)處理的存儲(chǔ)引擎,

移除分區(qū)可以用ALTER TABLE ... REMOVE PARTITIONING 

升級之前,需要把非InnoDB存儲(chǔ)引擎分區(qū)表使用ALTER TABLE ... ENGINE=INNODB轉(zhuǎn)換為InnoDB

--InnoDB文件變化

InnoDB:當(dāng)在Data directory外建立表空間時(shí),InnoDB不在創(chuàng)建.isl InnoDB動(dòng)態(tài)鏈接文件,

        所以不再支持服務(wù)器離線時(shí),修改.isl移動(dòng)遠(yuǎn)程表空間操作,利用redo log定位遠(yuǎn)程日志文件。

InnoDB:不再支持壓縮臨時(shí)表,當(dāng)row_format=compressed時(shí),innodb_strict_mode為true(default),create temporary table將報(bào)錯(cuò)

(12)新引入數(shù)據(jù)字典表

INFORMATION_SCHEMA.INNODB_CACHED_INDEXES:顯示索引緩存在內(nèi)存中的頁數(shù)量。

(13)AUTO_INCREMENT加強(qiáng)

 現(xiàn)在將AUTO_INCREMENT值寫入Redo log,寫入存儲(chǔ)引擎系統(tǒng)表,將自增最大值持久化,設(shè)置AUTO_INCREMENT=N不在不生效,

 手工update AUTO_INCREMENT 列也生效。

到此,關(guān)于“MySQL 8.0.20的新特性有哪些”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI