MySQL8.1 Official Release

2023-07-30 22:50:53
  • Capture EXPLAIN FORMAT=JSON output, Add options for EXPLAIN FORMAT=JSON, which can save the JSON-formatted output in a user variable.
  • Preserve client comments, MySQL 8.1 preserves comments in the mysql client. If you need to use the previous behavior, you need to use the --skip-comments option.
  • MySQL Replication changes SOURCE_RETRY_COUNT, The default value of SOURCE_RETRY_COUNT in the CHANGE REPLICATION SOURCE TO statement is changed to 10. This means that with this option and the default value of SOURCE_CONNECT_RETRY(60), the replica waits for 60 seconds between reconnection attempts and tries to reconnect for 10 minutes at this rate before timeouts and failovers.
  • group_replication_set_as_primary() and DDL statements, before selecting a new primary node, the group_replication_set_as_primary() function needs to wait for all ongoing DDL statements to complete all transactions.
  • The MySQL version number used in version-specific comments now supports a major version consisting of one or two digits, which means the entire version can now be five or six digits long.
  • Enhanced logging for the server shutdown process, with the increase in startup and shutdown messages for MySQL server, plugins, and components, enhanced logging for the shutdown process should help with troubleshooting and debugging issues, especially when the server takes a long time to shut down.
  • Added SHOW PARSE_TREE statement, which displays the JSON-formatted parse tree of a statement. This statement is only for testing and development, not for production. It is only used in debug versions.
  • Added the tls-certificates-enforced - validation system variable, which allows DBAs to enforce certificate validation upon server startup or when reloading certificates using the INSTANCE RELOAD TLS statement at runtime. When enforcement is enabled, the server will stop on startup if an invalid certificate is detected, preventing the loading of invalid certificates at runtime and issuing a warning.
  • Added several group replication-specific status variables that can improve diagnosis and troubleshooting of network instability, providing each group member with statistics on network usage, control messages, and data messages.
  • Added server system variables to control the time that MySQL accounts using LDAP-pluggable authentication must wait when the LDAP server is down or unresponsive. For the following simple SASL-based LDAP authentication variables, the new default timeout is 30 seconds. Connection and response timeouts can only be configured through system variables on the Linux platform. For more information, see Setting LDAP-pluggable authentication timeouts.


In addition to the new features, the following adjustments were made, which are basically consistent with MySQL 8.0.34.

In terms of user management, a system variable "validate_password.changed_characters_percentage" has been added for password validation. This variable is used to configure the number of characters that users must change when changing their passwords, calculated as a percentage of the number of characters in the current password. If the value of this variable is set to 50, at least half of the characters in the new password must be changed.

In the area of MySQL auditing, new features have been added. When installing the auditing plugin, it is now possible to specify the database where user log filtering conditions are stored. For example,


$> mysql -u root -D _name -p < audit_log_filter_linux_install.sql

Additionally, MySQL auditing has added a new feature that uses the scheduler component to configure and execute recurring tasks, such as refreshing memory caches.

Regarding binary logs, new functions mysql_binlog_open(), mysql_binlog_fetch(), and mysql_binlog_close() have been added to the libmysqlclient.so library, enabling developers to access the binary logs of the MySQL server.

In terms of compatibility, improved support for MSVC_CPPCHECK on Windows and checked similar MSVC warnings in "maintenance" mode.

For Windows compilation, improved support for WIN_DEBUG_NO_INLINE=1, usage will exceed the library's limit of 65535 objects.

Additionally, updates were made to robin-hood-hashing, ICU files, and ZSTD versions.

Since MySQL provides mysql shell and mysqldump for backup, mysqlpump will be downgraded, with warning prompts when used, and the product will be deprecated in the future.

The server variables "sync_relay_log_info" and "binlog_format" for replication are deprecated in this version and will be removed in the future. Therefore, the associated variables "log_bin_trust_function_creators" and "log_statements_unsafe_for_binlog" will also be deprecated. It should be noted that after the deprecation of "binlog_format", MySQL's binary log format will only support "row-based".

The server variable "group_replication_recovery_complete_at" for group replication and the "mysql_native_password" authentication plugin are deprecated in this version and will be removed in the future.

Additionally, traditional filtering modes for audit logs, the mysql_ssl_rsa_setup program, and keyring file plugins are deprecated in this version and will be removed in the future.

Users should note that the previous specific version comment format "!80034KEY_BLOCK_SIZE=1024*/" or "!80034 KEY_BLOCK_SIZE=1024*/" does not consider spaces after the version number, but this behavior may change in future versions. Therefore, starting from this version, users are requested to add a space after the version number when using it.

Regarding SQL syntax, this version supports using CURRENT_USER(), SESSION_USER(), USER(), and SYSTEM_USER() as the default values for Varchar or TEXT type fields in CREATE TABLE or ALTER TABLE statements.

In addition to the changes and deprecations mentioned above, MySQL 8.1 and MySQL 8.0.34 have made numerous bug fixes, bringing MySQL 8.0 to a stable state. For detailed change logs, please refer to the official release notes.


 Source: MySQL Solutions Engineer