New Features, Deprecations, and Removals in MySQL 9.0
MySQL 9.0, released July 2 2024, introduces EXPLAIN JSON output stored in variables, native EVENT DDL statements, and two new performance‑schema tables for variable metadata, while deprecating the old variables_info columns and removing the mysql_native_password plugin in favor of caching_sha2_password, enhancing observability and security.
MySQL 9.0 GA was released on July 2, 2024, six years after MySQL 8.0. This article outlines the most important changes in the new major version.
Added or Changed Features
EXPLAIN JSON output – MySQL 9.0 introduces the ability to store the JSON representation of an EXPLAIN ANALYZE plan into a user variable.
EXPLAIN ANALYZE FORMAT=JSON INTO @variable SELECT ...;The variable can then be used with any JSON function. The feature works only when the system variable explain_json_format_version is set to 2.
Example:
mysql> EXPLAIN FORMAT=JSON INTO @myselect
SELECT name FROM a WHERE id = 2;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @myselect\G
@myex: {
"query_block": {
"select_id": 1,
"cost_info": {"query_cost": "1.00"},
"table": {
"table_name": "a",
"access_type": "const",
"key": "PRIMARY",
"used_key_parts": ["id"],
"key_length": "4",
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00"
}
}
}After storing the plan, you can query parts of it with JSON functions, e.g.:
SELECT JSON_EXTRACT(@myselect, "$.query_block.table.key");DDL Event Syntax
MySQL 9.0 adds native support for CREATE EVENT , ALTER EVENT , and DROP EVENT statements.
CREATE EVENT [IF NOT EXISTS] event_name
ON SCHEDULE AT timestamp | EVERY interval
DO event_body;Simple example that increments a column after one hour:
CREATE EVENT myevent
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO UPDATE myschema.mytable SET mycol = mycol + 1;Performance Schema New Tables
Two new tables provide better visibility of system variables:
variables_metadata – name, scope, type, range and description of each server variable (replaces the deprecated MIN_VALUE and MAX_VALUE columns of variables_info ).
global_variable_attributes – key‑value pairs for attributes assigned to global variables.
Deprecated Features
The variables_info table columns MIN_VALUE and MAX_VALUE are deprecated; use variables_metadata instead.
Removed Features
The mysql_native_password authentication plugin and related server options/variables ( --mysql-native-password , --mysql-native-password-proxy-users , default_authentication_plugin ) have been removed. The default authentication plugin is now caching_sha2_password .
Summary
MySQL 9.0 adds EXPLAIN JSON output, native EVENT DDL, and two performance‑schema tables, deprecates the old variables_info columns, and drops the mysql_native_password plugin. The changes are mostly incremental and do not dramatically affect most applications, but they improve observability and security.
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.