参考链接:https://mysqlserverteam.com/the-complete-list-of-new-features-in-mysql-8-0/
There are over 300 new features in MySQL 8.0. The MySQL Manual is very good, but verbose. This is a list of new features in short bullet form. We have tried very hard to make sure each feature is only mentioned once. Note the similar list for MySQL 5.7.
Please download MySQL 8.0 from dev.mysql.com or from the MySQL Yum, APT, or SUSE repositories.
SQL DML
- Non-recursive CTEs [1]
- Recursive CTEs [1]
- Window functions [1]
- ORDER BY and DISTINCT with ROLLUP [1]
- LATERAL derived tables [1]
- Outer table references in derived tables [1]
- VALUES [1]
- Referencing old/new row in INSERT … ON DUPLICATE KEY UPDATE [1]
- LIMIT in recursive CTEs [1]
SQL DDL
- Instant ADD COLUMN [1]
- Instant RENAME COLUMN [1]
- Instant RENAME TABLESPACE [1]
- RESTART statement [1]
- SET PERSIST statement [1]
- RENAME TABLES under LOCK TABLES [1]
- Option to disallow tables without primary keys [1]
- Character set conversion as an inplace operation [1 2]
- CREATE TABLESPACE without DATAFILE clause [1]
- CREATE RESOURCE GROUP [1 2]
- ALTER RESOURCE GROUP [1 2]
- DROP RESOURCE GROUP [1 2]
- Expressions as DEFAULT values [1]
- CHECK constraint [1]
- ALTER TABLE … ADD CONSTRAINT [1]
- ALTER TABLE … DROP CONSTRAINT [1]
- ALTER TABLE … ALTER CONSTRAINT [1]
- CLONE INSTANCE [1]
Indexes
- Invisible indexes [1]
- Descending indexes [1]
- Functional indexes [1]
- Index skip scan [1]
- Index Hints USE / IGNORE / FORCE INDEX [1]
Functions
- New function REGEXP_INSTR [1]
- New function REGEXP_LIKE [1]
- New function REGEXP_REPLACE [1]
- New function REGEXP_SUBSTR [1]
- New function UUID_TO_BIN [1]
- New function BIN_TO_UUID [1]
- New function IS_UUID [1]
- New function GROUPING [1 2]
- New function STATEMENT_DIGEST [1]
- New function STATEMENT_DIGEST_TEXT [1]
- Bit operations allowed on BINARY, VARBINARY, BLOB, TINYBLOB, MEDIUMBLOB and LONGBLOB [1]
- TIMESTAMP/DATETIME values can now include timezone details [1]
JSON
- New function JSON_PRETTY [1]
- New function JSON_STORAGE_SIZE [1]
- New function JSON_STORAGE_FREE [1]
- New function JSON_MERGE_PATCH [1]
- New aggregation and window function JSON_ARRAYAGG [1]
- New aggregation and window function JSON_OBJECTAGG [1]
- New table function JSON_TABLE [1]
- Faster sorting of JSON values [1]
- Ranges in JSON patch expressions [1 2]
- In-place updates of JSON values [1 2]
- JSON Schema validation [1]
- JSON array indexes [1 2]
- New operator MEMBER_OF [1]
- New function JSON_OVERLAPS [1]
- New function JSON_VALUE [1]
GIS
- Spatial reference systems (SRSs) [1 2 3 4]
- CREATE SPATIAL REFERENCE SYSTEM statement [1 2]
- DROP SPATIAL REFERENCE SYSTEM statement [1]
- SRID type modifier [1 2]
- Geographic R-trees [1]
- New setter function ST_SRID(geometry, new_srid) [1]
- New setter function ST_X(geometry, new_x) [1]
- New setter function ST_Y(geometry, new_y) [1]
- New function ST_SwapXY [1]
- New function ST_Latitude [1]
- New function ST_Longitude [1]
- New function ST_Transform [1]
- Geography support in ST_Distance, ST_Contains, ST_Crosses, ST_Disjoint, ST_Equals, ST_Intersects, ST_Overlaps, ST_Touches, ST_Within, MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals, MBRIntersects, MBROverlaps, MBRTouches, MBRWithin, ST_IsSimple, ST_IsValid, ST_Length, ST_Validate, ST_Area [1 2 3 4 5 6 7 8]
- ST_Distance_Sphere for geographic geometries [1]
- Ellipsoidal ST_Distance between any two geometry types [1]
- GEOMCOLLECTION as synonym to GEOMETRYCOLLECTION [1 2 3]
- Optional SPATIAL keyword in R-tree index clauses [1]
- Ability to specify length unit in ST_Distance() [1]
- Ability to specify length unit in ST_Length() [1]
Character sets and collations
- UTF-8 (utf8mb4) as default character set [1 2 3 4 5 6 7 8 9 10 11]
- General Unicode 9.0 collations covering German (dictionary order), Austrian German (dictionary order), English, French (including accent insensitive Canadian French), Irish, Indonesian, Italian, Luxembourgian, Malay, Dutch (including Flemish), Portuguese (including Brazilian Portuguese), Swahili, and Zulu [1 2]
- Unicode 9.0 collation for Czech
- Unicode 9.0 collation for Danish (also valid for Norwegian)
- Unicode 9.0 collation for German (phonebook order)
- Unicode 9.0 collation for Esperanto
- Unicode 9.0 collation for Spanish
- Unicode 9.0 collation for Spanish (traditional)
- Unicode 9.0 collation for Estonian
- Unicode 9.0 collation for Croatian (also valid for Serbian with latin characters, and Bosnian)
- Unicode 9.0 collation for Hungarian
- Unicode 9.0 collation for Icelandic
- Unicode 9.0 collation for Lithuanian
- Unicode 9.0 collation for Latvian
- Unicode 9.0 collation for Polish
- Unicode 9.0 collation for Romanian
- Unicode 9.0 collation for Slovak
- Unicode 9.0 collation for Slovenian
- Unicode 9.0 collation for Swedish
- Unicode 9.0 collation for Turkish
- Unicode 9.0 collation for Vietnamese
- Unicode 9.0 collation for Japanese (including kana sensitive collation)
- Unicode 9.0 collation for Chinese
- Unicode 9.0 collation for Russian (also valid for Bulgarian)
- Unicode support in RLIKE and REGEXP [1]
- Unicode 9.0 code point order collation (utf8mb4_0900_bin) [1]
Information Schema
- Information Schema implemented as views over data dictionary tables [1]
- VIEW_TABLE_USAGE [1]
- VIEW_ROUTINE_USAGE [1]
- KEYWORDS [1]
- COLUMN_STATISTICS [1]
- ST_GEOMETRY_COLUMNS [1]
- ST_SPATIAL_REFERENCE_SYSTEMS [1]
- ST_UNITS_OF_MEASURE [1]
- RESOURCE_GROUPS [1]
- CHECK_CONSTRAINTS [1, 2]
- APPLICABLE_ROLES [1]
- ADMINISTRABLE_ROLE_AUTHORIZATIONS [1]
- ENABLED_ROLES [1]
- ROLE_TABLE_GRANTS [1]
- ROLE_COLUMN_GRANTS [1]
- ROLE_ROUTINE_GRANTS [1]
Performance Schema
- Performance Schema Indexes [1]
- Instrument server errors [1]
- Statements latency histograms [1]
- Instrument data locks [1]
- Pluggable performance schema tables [1]
- Added QUERY_SAMPLE_TEXT [1]
- Added Thread Pool Tables [1] (Enterprise)
SHOW
Optimizer
- Histograms [1 2 3]
- Adaptive scan buffer size [1]
- IO costs separation between memory and disk [1]
- Default values in cost tables [1]
- Sampling interface in storage engine API [1 2 3 4]
- NOWAIT and SKIP LOCKED [1 2]
- Avoid unnecesary index dives with FORCE INDEX [1 2 3]
- Optimizer switch to use invisible indexes [1 2 3]
- Increased default optimizer trace buffer size [1]
- New hint MERGE [1]
- New hint INDEX_MERGE [1]
- New hint NO_INDEX_MERGE [1]
- New hint JOIN_FIXED_ORDER [1]
- New hint JOIN_ORDER [1]
- New hint JOIN_PREFIX [1]
- New hint JOIN_SUFFIX [1]
- New hint SET_VAR [1]
- Consider covering prefix indexes for LIKE [1]
- Transformed statement in EXPLAIN of INSERT/UPDATE/REPLACE/DELETE [1]
- EXPLAIN ANALYZE [1]
- HASH JOIN (inner-, outer-, anti- and semijoin) [1]
- Batch Key Access in the iterator executor [1 2]
- Enhanced group-by loose index scan [1]
- New optimizer switch to disable limit optimization [1]
- Semijoin now works with single-table UPDATE/DELETE [1 2]
InnoDB
- Highly scalable latch free redo log implementation [1 2].
- Redesign of LOB infrastructure for better performance [1 2 3]
- State of the art lock scheduler using Contention Aware Transaction Scheduling (CATS) (Contribution from University of Michigan) [1]
- Infrastructure to do non locking parallel reads (currently used by CHECK TABLE) [1]
- Instant add column and virtual column [1]
- Report pages cached in the buffer pool by indexes via the information schema [1]
- Persistent auto increment [1]
- Manage UNDO tablespaces using SQL syntax [1]
- New in-memory temptable storage engine for use by optimiser [1]
- Support for BLOBs in new temptable engine [1 2]
- Dedicated server mode, automatically configures the buffer pool and redo log size [1 2]
- Remove the buffer pool mutex (Percona contribution) [1]
- Improved purge [1]
- Dynamically enable/disable the deadlock detector [1]
- IO layer is now more scalable and efficient [1]
- Extended locking semantics with skip and no-waits [1 2]
- Use the new error logging infra structure [1]
- System data dictionary is now stored in InnoDB [1]
- New configuration to generate smaller core files [1]
- Deprecate Shared tablespaces in partitioned table [1]
- Reclaim temporary tablespace disk space online [1]
- New option to control write IOPs when idle [1]
- Support for table data sampling for histograms [1]
- Case insensitive names for partition tables [1]
- Improved CATS implementation (Lock manager) [1]
- Lock-sys optimization: sharded lock_sys mutex [1]
- Write double write buffer to a separate file to ensure atomic writes [1]
- Enable/disable redo log globally [1]
- CREATE/TRUNCATE of undo tablespaces are now redo logged [1]
- Tablespace filename validation has been made optional [1]
- Tablespaces has been restricted to known directories [1 2]
Data Dictionary, Atomic and crash safe DDL, Upgrade
- Transactional Data Dictionary [1]
- Store all meta data in InnoDB, no FRMs, TRG etc [1,2]
- Store redundant copy of meta data in SDI [1]
- Tablespace version support for better upgrade/downgrade experience [1]
- Self describing tablespaces with Serialized Dictionary Information (SDI) [1]
- Tools to manage the SDI [ 1]
- Atomic and crash safe DDL [1]
- CREATE TABLE…SELECT has been made atomic and crash-safe [1]
- Automatic upgrade of dictionary tables, and enhanced checks [1]
- Automatic upgrade, no need for mysql_upgrade script [1]
Network
- Support multiple addresses for the –bind-address command option [1]
- Add Admin Port [1 2 3 4 5]
- Remove mutex bottlenecks for connect/disconnect performance [1]
- Support host names longer than 60 characters [1]
Error logging
- Improved error logging in 8.0 [1]
- Defaults change: log_error_verbosity=2 [1]
- Added severity, error code, subsystem to error messages [1]
- Filtering the error log [1]
- Error logging in JSON format [1]
- Force-print specific non-error messages to error log [1]
- Suppress error logs of type warning or note [1]
- New “syseventlog” settings [1]
- Added –log-slow-extra, for richer slow logging [1]
- Added new “ts” timestamp for JSON error log [1]
Replication
- Multi-source Replication Per Channel Filters [1]
- Atomic DDL Recovery With The Binary Log [1]
- Write-set Based Transaction Dependency Tracking [1 2 ]
- Reduced Contention Between Receiver and Applier Threads [1]
- GTID Support for Temporary Tables Inside Transactions [1]
- Partial JSON Update Replication [1]
- Extended table metadata in the binary log [1 2]
- RESET MASTER TO ‘x’ [1]
- Settable GTID_PURGED When GTID_EXECUTED is Not Empty [1]
- Sub-second Binary Logs Expiration Settings [1]
- Non-Blocking Replication Monitoring even when Disk is Full [1]
- Transaction Byte Length Metadata in Binary log [1]
- Server Versions for each Transaction in the Binary Log [1, 2, 3]
- Support for START SLAVE UNTIL for Multi-Threaded Applier [1]
- Delayed Replication in Microseconds [1]
- binlog-row-event-max-size system variable [1]
- PFS: Applier Lag and Queues Monitoring [1 2 3]
- PFS: Read Consistent Log Positions for Backups [1]
- PFS: Row-based Replication Applier Thread Progress [1]
- PFS: Counters for Replication Applier Retries [1]
- Rotating binary log master key online [1]
- Partition metadata in the Binary Log [1]
- Encrypt binary log caches [1]
- Protocol compression support for mysqlbinlog [1]
- Replication with privilege checks [1 2]
- New CHANGE MASTER … REQUIRE_ROW_FORMAT option [1]
- New slave_preserve_commit_order option [1]
- Binary log compression [1]
- Enable/disable primary key checks on slaves [1]
Group Replication
- Transaction Savepoint Support [1]
- Disallow Writes to Isolated Members in Group Replication [1 2 3]
- Group-wide Certification and Applier Stats Monitoring [1 2]
- Options to Fine-tune the Flow-Control [1 2 3 4 5 6 7 8]
- Support for Hostnames in the Whitelist [1]
- Shutdown Server When Server Drops Out of the Group [1]
- Online and User-Triggered Primary Switchover/Election [1 2]
- Online and User-Triggered Single-to-Multi Primary Switchover [1 2]
- Configurable Messaging Pipelining [1 2]
- Relaxed Member Eviction [1]
- Consistent Reads [1]
- Consistent Reads on Primary Fail-over [1]
- IPv6 Support [1 2]
- Tracing for Message Passing [1]
- Configure primary failover candidates priority [1 2]
- PFS: Instrumented Threads [1 2]
- PFS: Instrumented Mutexes and Condvars [1 2]
- PFS: Instrumented Memory Used for the Message Cache [1 2]
- Better support for large transactions in GR [1 1]
- Ability to configure the GR communication protocol [1 1]
- Changed EXIT STATE ACTION default to READ_ONLY [1]
- Auto-rejoin of Group Members [1 2]
- New fencing mode for Group Replication: OFFLINE_MODE [1 2]
- Group Replication distributed recovery with automated instance cloning [1]
- Enhanced cross-version inter-operability for Group Replication [1]
- TLS 1.3 support for Group Communication System (GCS/XCom) [1 2]
- Group Delivery Message Service [1]
- Lower minimum value of group_replication_message_cache_size [1]
- Increase default group_replication_autorejoin_tries [1]
- Increase default group_replication_member_expel_timeout [1]
- IPs and ports used during GR distributed recovery can now be specified [1]
- Classify important GR log messages as system messages [1]
- START GROUP_REPLICATION to support credentials as parameters [1]
- Added support for binary log checksums in GR [1]
Security – Authentication
- Caching sha2 authentication plugin [1]
- Introduce delays in authentication based on failed logins [1]
- Password rotation policy enforcement [1]
- Old password required for SET PASSWORD for some users [1]
- Support 2 active passwords per user account [1]
- Identification by RANDOM PASSWORD [1 2]
- Option to display passwords as hexadecimal strings [1]
- Extra authentication to allow SET PERSIST for security sensitive variables [1]
- SASL authentication for LDAP on windows [1] (Enterprise)
- LDAP authentication plugin (client and server) [1] (Enterprise)
- Support for users with multiple LDAP groups [1] (Enterprise)
- LDAP GSSAPI/Kerberos authentication [1] (Enterprise)
- Allow users to store user account COMMENT/ATTRIBUTE into the mysql.user table [1]
- Support separate set of TLS certificates for admin connection port [1]
Security – Authorization
- SQL Roles [1]
- Break the SUPER privilege into dynamic privileges [1]
- Granting default roles when new users are created [1 2 3]
- Additional safety to –skip-grant-tables [1]
- Secure session variable setting (MYSQL_SESSION_ADMIN privilege) [1]
- Checking authorization for rolling back XA-transactions [1]
- Added Partial Revokes [1]
- Added the SYSTEM_USER dynamic privilege [1]
- FAILED_LOGIN_ATTEMPTS/PASSWORD_LOCK_TIME counters per user [1]
- Added the SHOW_ROUTINE privilege [1]
Security – Auditing
- Audit log: abort queries on rule based conditions [1] (Enterprise)
- Audit log: JSON format, compression and encryption [1] (Enterprise)
- Audit log: SQL function to inject data into the Audit log [1] (Enterprise)
- Audit log: Multiple encryption passwords [1] (Enterprise)
Security – Encrypt Data at Rest
- Control Table encryption [1]
- Redo log encryption [1]
- Undo log encryption [1]
- General Tablespace encryption [1]
- System Tablespace encryption [1]
- Binary Log encryption [1]
Security – Keyring
- Server as a keyring backend migration tool [1]
- Keyring plugin for AWS KMS [1] (Enterprise)
- Keyring plugin for Hashicorp Vault [1] (Enterprise)
- Allow users to store, retrieve, and manage any opaque data in the keyring [1]
Security – Data Masking
- Data masking functions [1] (Enterprise)
Security – SSL & Other
- Atomic ACL statements [1]
- OpenSSL Only [1]
- Support for FIPs enabled OpenSSL library [1 2]
- Ensure that foreign key error does not reveal information about parent table [1]
- Added support for TLS 1.3 [1]
- Allow switching SSL options for a running server [1]
- The –ssl-mode client side option to streamline SSL checking [1]
- Support for TLS 1.3 in Asynchronous Replication: MASTER_TLS_CIPHERSUITES option on CHANGE MASTER command, the group_replication_recovery_tls_version plugin option and the group_replication_recovery_tls_ciphersuites plugin option [1]
Shell
- InnoDB Cluster: A packaged solution for Shell, Router, and Group Replication [1 2]
- InnoDB ReplicaSet: A packaged solution for Shell, Router, and Async. Replication [1]
- Remote MySQL server configuration and re-configuration for InnoDB clusters [1]
- Extended cluster status display, including replication lag times [1]
- Manual primary switch-over and topology re-configuration in InnoDB clusters [1]
- Advanced cluster customizations for more use-cases and environments
- MySQL server upgrade checker [1, 2]
- Import JSON and JSON serialized BSON data [1, 2]
- Updated X DevAPI support
- Secure password management [1, 2]
- Display column metadata for query results [1]
- Direct command line execution of shell APIs [1]
- Improved built-in help [1]
- Screen paging [1]
- Auto-completion [1]
- Persisted command history by Shell mode. [1]
- Custom prompts [1]
- The \sql shell command also works in JavaScript or Python mode [1]
- Support for server monitoring through user defined reports and the \show and \watch shell commands [1]
- Parallel Data Import Utility [1]
- Support for Shell Extensions [1]
- Support for Shell Plugins [1 2]
- Support for different result formats: Table, tabbed, vertical, json/raw, json/pretty [1]
- MySQL Shell Logical Dump and Load Utilities [1 2 3 4 5]
- Support for hiding instances on MySQL InnoDB Cluster/ReplicaSet [1]
Router
- Persist last known metadata-server addresses [1]
- Reset max_connect_errors on successful connections [1]
- Build Router as part of the MySQL Server source-tree [1]
- Added mysqlrouter_plugin_info tool [1]
- Reduced metadata-cache TTL from 300s to 500ms [1]
- Added routing strategies [1]
- Added bootstrap option for –report-host [1]
- Added bootstrap option for –account-host [1]
- Disconnect clients to server-nodes that changed from PRIMARY to SECONDARY [1]
- Log-rotation via SIGHUP [1]
- HTTP server plugin [1]
- Flexible support for single/multi-PRIMARY Group Replication [1]
- New mysqlrouter_keyring utility [1]
- Sub-second timestamp resolution in router log [1]
- Support for ReplicaSet in Router [1]
- Handle the metadata upgrade in the Router [1]
- New bootstrap option (–account) to allow reuse of an existing account [1]
- Authenticating the HTTP component against the MySQL Innodb Cluster metadata [1]
- New pid-file option [1]
- New “note” and “system” log level [1]
- User configurable log filename [1]
- Support hiding nodes from applications [1]
- Connection compression in the X Plugin / X Protocol [1]
- Zstd compression in the X Plugin / X Protocol [1]
- Configurable compression level in the X Plugin / X Protocol [1]
- Document schema validator in the X Plugin [1]
- Multiple –mysqlx-bind-address now supported in the X Plugin [1]
Misc
- Defaults change: Binlog is ON [1 2]
- Defaults change: X Protocol is Enabled [1]
- Defaults change: master_info_repository = TABLE [1 2]
- Defaults change: relay_log_info_repository = TABLE [1 2]
- Defaults change: explicit_defaults_for_timestamp= ON [1]
- Defaults change: max_error_count=1024 [1]
- Renamed tx_read_only variable to transaction_read_only [1]
- Renamed tx_isolation variable to transaction_isolation [1]
- Defaults change: max_allowed_packet=67108864 [1]
- Defaults change: event_scheduler=ON [1]
- Defaults change: back_log=-1 (auto-sized) [1]
- Defaults change: table_open_cache=4000 [1 2]
- Added mysqld_safe-functionality to server [123]
- Minimal tarballs [1]
- New Backup Lock [1]
- Server version stored in InnoDB tablespaces [1]
- Enable MDL Locking for Recovered and Detached Prepared XA Transactions [1]
- Support meta data locking for Foreign Keys [1]
- The service registry and the component infrastructure [1]
- CLI interface to read the replication stream [1]
- UDF registration service to allow components to auto-register UDFs [1]
- MySQL server strings component service [1]
- Make result set metadata transfer optional [1]
- Status variables service for components [1]
- Performance schema instrumentation via a component service [1]
- System variables service for components [1]
- Password validation plugin implemented as a component [1]
- Component service to deliver signals to the host application
- Allow plugins to use prepared statements [1]
- INSERT/UPDATE/DELETE in query rewrite plugin [1]
- Dynamic allocation of sort buffer [1]
- Variable length sort keys for NO PAD collations [1]
- Faster SELECT COUNT (*) without grouping [1]
- Source code improvements [1]
- Small tarball download option [1]
- CAST to FLOAT and DOUBLE [1]
- OS user as a connection attribute [1]
- gtid_purged as a comment in mysqldump files [1]
- Early plugin load flag [1]
- Current thread component service [1]
- Mutex lock order tool [1]
- Connection compression control [1]
- Dynamic linking of Protobuf [1]
- Increase max value for max_prepared_stmt_count [1]
- Move sys Schema to the mysql server tree [1]
- Compile time check of error message arguments [1]
- Identifying the exact location where a document violates a schema constraint [1]
- Command line tool’s –binary-as-hex on by default for interactive terminals [1]
- Character Sets in the User Defined Functions API [12]
- Sys Schema: Stored functions have been replaced by native functions [1]
- The “system” mysql command line command now also works on Windows [1]
- Admin sessions are not subject to the max_connection limit [1]
- Duplicate key error information now includes the table name of the key [1]
- Use signal SIGUSR1 to flush logs [1]
- The MySQL C API now supports compression for asynchronous functions [1]
- Client library safe LOAD DATA LOCAL INFILE directories [1]