Release Notes
Product Announcements
Usage of old temporal typeProblem | Description |
Affected Data Types | TIME, DATETIME, TIMESTAMP |
Characteristics of the Old Format | The column type display contains "5.5 binary format". |
Reasons for Incompatibility | MySQL 8.0 has completely removed support for the old temporal format. |
SELECT table_schema, table_name, column_name, column_typeFROM information_schema.columnsWHERE column_type LIKE '%5.5 binary format%';
-- Rebuild each detected tableALTER TABLE database_name.table_name FORCE;
Schema inconsistencies resulting from file removal or corruption.Problem | Description |
Common Causes | Manual deletion of data files, disk failures, file system errors |
Manifestations | The table exists in the InnoDB data dictionary but not in information_schema.tables. |
Upgrade Impacts | The new data dictionary in MySQL 8.0 is unable to correctly migrate these inconsistent tables. |
-- Find records that exist in InnoDB but not in the TABLES tableSELECT t.NAME as table_nameFROM information_schema.innodb_sys_tables tLEFT JOIN information_schema.tables itON CONCAT(it.TABLE_SCHEMA, '/', it.TABLE_NAME) = t.NAMEWHERE it.TABLE_NAME IS NULLAND t.NAME NOT LIKE 'SYS_%'AND t.NAME NOT LIKE 'mysql/%';
grep -i "corrupt\\|missing\\|error" /var/log/mysql/error.log
ls -la /var/lib/mysql/database_name/
-- If the table is indeed no longer needed, clean up the InnoDB data dictionary-- Need to create an empty table with the same name and then delete itCREATE TABLE database_name.table_name (id INT) ENGINE=InnoDB;DROP TABLE database_name.table_name;-- If data recovery is needed, attempt to restore from backup
Spatial data columns created in MySQL 5.6.Problem | Description |
Affected Data Types | POINT, GEOMETRY, POLYGON, LINESTRING, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION |
Version Limitations | Versions prior to 8.0.24 cannot upgrade these tables. |
Recommended Solution | Directly upgrade to version 8.0.24 or newer |
-- Find affected tablesSELECT table_schema, table_name, column_name, data_typeFROM information_schema.columnsWHERE data_type IN ('point', 'geometry', 'polygon', 'linestring','multipoint', 'multilinestring', 'multipolygon','geometrycollection');-- Rebuild tableALTER TABLE database_name.table_name FORCE;
has done instant ddl, cannot upgrade to 8.0.INSTANT ADD COLUMN feature), and the metadata format generated by such operations is incompatible with MySQL 8.0.Problem | Description |
What is Instant DDL | A feature for quickly adding columns that modifies only the table's metadata without rewriting the table data, enabling column addition operations to be completed within seconds. |
Reasons for Incompatibility | MySQL 5.7 (specific cloud vendor versions) and MySQL 8.0 have different implementations of Instant DDL, resulting in variations in data dictionary formats. |
Changes in MySQL 8.0 | MySQL 8.0 has redesigned the data dictionary structure, introducing new mechanisms such as row_version, which cannot correctly parse the legacy Instant DDL metadata from MySQL 5.7. |
-- 1. Check which tables have undergone Instant DDLSELECT b.name from information_schema.INNODB_SYS_INSTANT_COLS a join information_schema.INNODB_SYS_TABLES b on a.table_id=b.table_id;-- 2. Check which tables have undergone modify columnSELECT b.name from information_schema.INNODB_SYS_INSTANT_MODIFIED_COLS a join information_schema.INNODB_SYS_TABLES b on a.table_id=b.table_id;-- 3. Rebuild these tables (choose one of the following)-- Method 1:OPTIMIZE TABLE database_name.table_name;-- Method 2:ALTER TABLE database_name.table_name ENGINE=InnoDB;
Issues reported by 'check table x for upgrade' command.CHECK TABLE ... FOR UPGRADE command for all non-system tables, which detects various potential issues in the tables.-- Manually perform the checkCHECK TABLE database_name.table_name FOR UPGRADE;-- Fix based on the specific error message returned-- Common fixes:REPAIR TABLE database_name.table_name;-- orALTER TABLE database_name.table_name FORCE;
MySQL 8.0 syntax check for routine-like objects.Problem | Description |
Check object | Stored procedures, functions, triggers, events |
Common Causes | Using new version reserved keywords as identifiers |
Detection method | Validate definitions using the MySQL 8.0 syntax parser |
-- 1. View stored procedures/functions definitionsSHOW CREATE PROCEDURE database_name.procedure_name;SHOW CREATE FUNCTION database_name.function_name;-- 2. Add backticks to conflicting identifiers-- BEFORE MODIFICATIONCREATE PROCEDURE test()BEGINSELECT rank FROM users; -- rank is a reserved word in MySQL 8.0END;-- AFTER MODIFICATIONCREATE PROCEDURE test()BEGINSELECT `rank` FROM users;END;-- 3. Recreate the stored procedureDROP PROCEDURE IF EXISTS database_name.procedure_name;CREATE PROCEDURE database_name.procedure_name ...
Usage of db objects with names conflicting with new reserved keywordsEdition | Newly Added Reserved Keywords |
8.0.11 | ADMIN, CUBE, CUME_DIST, DENSE_RANK, EMPTY, EXCEPT, FIRST_VALUE, FUNCTION, GROUPING, GROUPS, JSON_TABLE, LAG, LAST_VALUE, LEAD, NTH_VALUE, NTILE, OF, OVER, PERCENT_RANK, PERSIST, PERSIST_ONLY, RANK, RECURSIVE, ROW, ROWS, ROW_NUMBER, SYSTEM, WINDOW |
8.0.14 | LATERAL |
8.0.17 | ARRAY, MEMBER |
8.0.31 | FULL, INTERSECT |
-- 1. Find objects using reserved keywordsSELECT table_schema, table_name, column_nameFROM information_schema.columnsWHERE column_name IN ('RANK', 'ROWS', 'GROUPS', 'FUNCTION', 'SYSTEM', ...);-- 2. Modify the SQL in user applications by adding backticks to these identifiers-- BEFORE MODIFICATIONSELECT rank, rows FROM my_table;-- AFTER MODIFICATIONSELECT `rank`, `rows` FROM my_table;-- 3. Or rename the objects (if feasible)ALTER TABLE my_table CHANGE rank ranking INT;
Usage of utf8mb3 charsetutf8 (that is, utf8mb3) character set. In MySQL 8.0, utf8mb3 has been deprecated, and it is recommended to use utf8mb4.Problem | Description |
utf8mb3 limitation | utf8mb3 can only store up to 3-byte UTF-8 characters. |
utf8mb4 advantages | Supports full Unicode, including emoji. |
Changes in MySQL 8.0 | utf8 alias will point to utf8mb4 in future versions. |
-- 1. Find objects using utf8/utf8mb3SELECT table_schema, table_name, column_name, character_set_nameFROM information_schema.columnsWHERE character_set_name IN ('utf8', 'utf8mb3') and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Convert database character setALTER DATABASE database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;-- 3. Convert table character setALTER TABLE database_name.table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;-- 4. Batch conversion scriptSELECT CONCAT('ALTER TABLE `', table_schema, '`.`', table_name,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;')FROM information_schema.tablesWHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')AND table_collation LIKE 'utf8_%';
Table names in the mysql schema conflicting with new tables in 8.0mysql system database contains user tables with the same name as the newly added system tables in MySQL 8.0.catalogs, character_sets, collations, column_type_elements, columns,dd_properties, events, foreign_key_column_usage, foreign_keys,index_column_usage, index_partitions, index_stats, indexes,parameter_type_elements, parameters, routines, schemata,st_spatial_reference_systems, table_partition_values, table_partitions,table_stats, tables, tablespace_files, tablespaces, triggers,view_routine_usage, view_table_usage, component, default_roles,global_grants, innodb_ddl_log, innodb_dynamic_metadata,password_history, role_edges
-- 1. Find conflicting tablesSELECT table_nameFROM information_schema.tablesWHERE table_schema = 'mysql'AND table_name IN ('catalogs', 'character_sets', 'collations', ...);-- 2. Rename conflicting tablesRENAME TABLE mysql.conflicting_table_name TO mysql.conflicting_table_name_backup;-- or move to other databasesRENAME TABLE mysql.conflicting_table_name TO other_db.table_name;
Foreign key constraint names longer than 64 characters-- 1. Find constraint names exceeding the length limitSELECT i.TABLE_SCHEMA, i.TABLE_NAME, i.CONSTRAINT_NAME,LENGTH(i.CONSTRAINT_NAME) as name_lengthFROM information_schema.TABLE_CONSTRAINTS iWHERE i.CONSTRAINT_TYPE = 'FOREIGN KEY'AND LENGTH(i.CONSTRAINT_NAME) > 64;-- 2. Recreate the foreign key constraint-- Delete the old constraint firstALTER TABLE database_name.table_name DROP FOREIGN KEY old_constraint_name;-- Then create a new constraint (using a shorter name)ALTER TABLE database_name.table_nameADD CONSTRAINT new_constraint_name FOREIGN KEY (column_name) REFERENCES referenced_table(referenced_column);
Usage of obsolete MAXDB sql_mode flag.MAXDB sql_mode option.Problem | Description |
MAXDB Mode Purpose | Make DATETIME behave like TIMESTAMP. |
Upgrade Impacts | MySQL 8.0 automatically clears this mode, which may affect date handling for dates before 1970 or after 2037. |
-- 1. Identify objects using the MAXDB modeSELECT ROUTINE_SCHEMA, ROUTINE_NAME, SQL_MODEFROM information_schema.ROUTINESWHERE SQL_MODE LIKE '%MAXDB%';-- 2. Recreate the stored procedure, removing the MAXDB mode-- Export stored procedure definitionSHOW CREATE PROCEDURE database_name.procedure_name;-- Modify SQL_MODE, remove MAXDB-- Recreate the stored procedure
Usage of obsolete sql_mode flags.-- 1. Find objects using obsolete modesSELECT ROUTINE_SCHEMA, ROUTINE_NAME, SQL_MODEFROM information_schema.ROUTINESWHERE SQL_MODE REGEXP 'DB2|MSSQL|MYSQL323|MYSQL40|NO_AUTO_CREATE_USER|ORACLE|POSTGRESQL';-- 2. Recreate the object, removing obsolete sql_mode flags
ENUM/SET column definitions containing elements longer than 255 characters.-- 1. Find elements exceeding the length limitSELECT table_schema, table_name, column_name, data_type, character_maximum_lengthFROM information_schema.columnsWHERE data_type IN ('enum', 'set')AND character_maximum_length > 255 and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Modify column definitions to shorten element valuesALTER TABLE database_name.table_nameMODIFY COLUMN column_name ENUM('short_value1', 'short_value2', ...);
Usage of removed functionsRemoved Functions | Alternative Solution |
ENCODE() | AES_ENCRYPT() |
DECODE() | AES_DECRYPT() |
ENCRYPT() | SHA2() |
DES_ENCRYPT() | AES_ENCRYPT() |
DES_DECRYPT() | AES_DECRYPT() |
PASSWORD() | No direct alternative; use application-layer encryption. |
AREA() | ST_AREA() |
ASBINARY() | ST_ASBINARY() |
ASTEXT() | ST_ASTEXT() |
BUFFER() | ST_BUFFER() |
CENTROID() | ST_CENTROID() |
CONTAINS() | MBRCONTAINS() or ST_CONTAINS() |
CROSSES() | ST_CROSSES() |
DIMENSION() | ST_DIMENSION() |
DISJOINT() | MBRDISJOINT() or ST_DISJOINT() |
DISTANCE() | ST_DISTANCE() |
ENDPOINT() | ST_ENDPOINT() |
ENVELOPE() | ST_ENVELOPE() |
EQUALS() | MBREQUALS() or ST_EQUALS() |
EXTERIORRING() | ST_EXTERIORRING() |
GEOMCOLLFROMTEXT() | ST_GEOMCOLLFROMTEXT() |
GEOMCOLLFROMWKB() | ST_GEOMCOLLFROMWKB() |
GEOMETRYCOLLECTION() | ST_GEOMETRYCOLLECTION() |
GEOMETRYN() | ST_GEOMETRYN() |
GEOMETRYTYPE() | ST_GEOMETRYTYPE() |
GEOMFROMTEXT() | ST_GEOMFROMTEXT() |
GEOMFROMWKB() | ST_GEOMFROMWKB() |
GLENGTH() | ST_LENGTH() |
INTERIORRINGN() | ST_INTERIORRINGN() |
INTERSECTS() | MBRINTERSECTS() or ST_INTERSECTS() |
ISCLOSED() | ST_ISCLOSED() |
ISEMPTY() | ST_ISEMPTY() |
ISSIMPLE() | ST_ISSIMPLE() |
LINEFROMTEXT() | ST_LINEFROMTEXT() |
LINEFROMWKB() | ST_LINEFROMWKB() |
LINESTRING() | ST_LINESTRING() |
MLINEFROMTEXT() | ST_MLINEFROMTEXT() |
MLINEFROMWKB() | ST_MLINEFROMWKB() |
MPOINTFROMTEXT() | ST_MPOINTFROMTEXT() |
MPOINTFROMWKB() | ST_MPOINTFROMWKB() |
MPOLYFROMTEXT() | ST_MPOLYFROMTEXT() |
MPOLYFROMWKB() | ST_MPOLYFROMWKB() |
MULTILINESTRING() | ST_MULTILINESTRING() |
MULTIPOINT() | ST_MULTIPOINT() |
MULTIPOLYGON() | ST_MULTIPOLYGON() |
NUMGEOMETRIES() | ST_NUMGEOMETRIES() |
NUMINTERIORRINGS() | ST_NUMINTERIORRINGS() |
NUMPOINTS() | ST_NUMPOINTS() |
OVERLAPS() | MBROVERLAPS() or ST_OVERLAPS() |
POINTFROMTEXT() | ST_POINTFROMTEXT() |
POINTFROMWKB() | ST_POINTFROMWKB() |
POINTN() | ST_POINTN() |
POLYFROMTEXT() | ST_POLYFROMTEXT() |
POLYFROMWKB() | ST_POLYFROMWKB() |
POLYGON() | ST_POLYGON() |
SRID() | ST_SRID() |
STARTPOINT() | ST_STARTPOINT() |
TOUCHES() | ST_TOUCHES() |
WITHIN() | MBRWITHIN() or ST_WITHIN() |
X() | ST_X() |
Y() | ST_Y() |
-- 1. Find views that use removed functionsSELECT table_schema, table_name, view_definitionFROM information_schema.viewsWHERE view_definition REGEXP 'ENCODE|DECODE|ENCRYPT|PASSWORD|\\\\bAREA\\\\b|\\\\bASBINARY\\\\b'and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Modify the view definition to use alternative functionsCREATE OR REPLACE VIEW view_name ASSELECT ST_AREA(geom_column) AS area -- Replace AREA()FROM table_name;-- 3. Similarly modify stored procedures, triggers, etc.
Usage of removed GROUP BY ASC/DESC syntaxGROUP BY ... ASC/DESC syntax.Problem | Description |
legacy syntax | GROUP BY column ASC or GROUP BY column DESC |
Changes in MySQL 8.0 | GROUP BY no longer supports the ASC/DESC modifiers. |
Correct Practices | Sorting should be done using the ORDER BY clause. |
-- BEFORE MODIFICATION (Incorrect)SELECT category, COUNT(*)FROM productsGROUP BY category DESC;-- AFTER MODIFICATION (Correct)SELECT category, COUNT(*)FROM productsGROUP BY categoryORDER BY category DESC;
Zero Date, Datetime, and Timestamp values.0000-00-00), or the sql_mode does not include NO_ZERO_DATE and NO_ZERO_IN_DATE.Problem | Description |
Default Behavior Changes | MySQL 8.0 does not allow zero date values by default. |
Impact Scope | Column default values, existing data |
sql_mode changes | NO_ZERO_DATE and NO_ZERO_IN_DATE are enabled by default. |
-- 1. Find columns using zero date default valuesSELECT table_schema, table_name, column_name, column_defaultFROM information_schema.columnsWHERE column_default LIKE '0000-00-00%'and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Find data containing zero datesSELECT COUNT(*) FROM table_name WHERE date_column = '0000-00-00';-- 3. Update zero dates to valid valuesUPDATE table_name SET date_column = '1970-01-01' WHERE date_column = '0000-00-00';-- 4. Modify column default valuesALTER TABLE table_name ALTER COLUMN date_column SET DEFAULT '1970-01-01';-- orALTER TABLE table_name ALTER COLUMN date_column SET DEFAULT CURRENT_TIMESTAMP;
Table names containing 'FTS'-- 1. Find table names containing 'FTS'SELECT table_schema, table_nameFROM information_schema.tablesWHERE table_name LIKE BINARY '%FTS%';-- 2. Temporarily rename before upgrade (by changing any letter to lowercase)RENAME TABLE myFTStable TO myFtStable;-- 3. Can revert to original name after upgrade completionRENAME TABLE myFtStable TO myFTStable;
Indexes on functions with changed semanticsProblem | Description |
Influence Functions | CAST, CONVERT |
Potential Issues | May cause replication issues and index corruption. |
Applicable Versions | Upgrade to 8.0.28+ requires attention |
-- 1. Find affected generated columnsSELECT table_schema, table_name, column_name, generation_expressionFROM information_schema.columnsWHERE generation_expression IS NOT NULLAND generation_expression REGEXP 'CAST|CONVERT' and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Rebuild indexALTER TABLE table_name DROP INDEX index_name;ALTER TABLE table_name ADD INDEX index_name (generated_column_name);
Check for invalid table names and schema names used in 5.7#mysql50#, which is a legacy naming convention from MySQL 5.0.-- 1. Use mysqlcheck to repairmysqlcheck --check-upgrade --all-databasesmysqlcheck --fix-db-names --fix-table-names --all-databases-- 2. Or use SQL commandsALTER DATABASE `#mysql50#old_name` UPGRADE DATA DIRECTORY NAME;
Check for orphaned routines in 5.7-- 1. Find orphaned stored proceduresSELECT ROUTINE_SCHEMA, ROUTINE_NAME, 'is orphaned'FROM information_schema.routinesWHERE NOT EXISTS (SELECT SCHEMA_NAMEFROM information_schema.schemataWHERE ROUTINE_SCHEMA = SCHEMA_NAME);-- 2. Delete orphaned stored proceduresDROP PROCEDURE IF EXISTS non-existent_schema.procedure_name;DROP FUNCTION IF EXISTS non-existent_schema.function_name;
Check for deprecated usage of single dollar signs in object names$ but do not end with $, this is a deprecated usage.-- Modify the object names to end with $-- For example: change $example to $example$ or exampleRENAME TABLE `$mytable` TO `$mytable$`;-- orRENAME TABLE `$mytable` TO `mytable`;
Check for indexes that are too large to work on higher versions of MySQL Server than 5.7-- 1. Find indexes that are too largeSELECT table_schema, table_name, index_name,GROUP_CONCAT(column_name) as columnsFROM information_schema.statisticsWHERE table_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')GROUP BY table_schema, table_name, index_nameHAVING SUM(sub_part) > 767 OR (SUM(sub_part) IS NULL AND COUNT(*) > 1);-- 2. Drop indexes that are too largeALTER TABLE table_name DROP INDEX index_name;-- 3. Consider using prefix indexes or changing the row formatALTER TABLE table_name ROW_FORMAT=DYNAMIC;ALTER TABLE table_name ADD INDEX index_name (column_name(191));
Check for deprecated '.<table>' syntax used in routines..<table> syntax (omitting the database name, with only the dot and table name).-- Modify the stored procedure to use the full database.table syntax-- BEFORE MODIFICATIONSELECT * FROM .mytable;-- AFTER MODIFICATIONSELECT * FROM mydb.mytable;
Check for columns that have foreign keys pointing to tables from a different database engineFOREIGN_KEY_CHECKS=0 is set and caused by incorrect operations.-- 1. Find invalid foreign keysSELECTfk.TABLE_SCHEMA, fk.TABLE_NAME, fk.CONSTRAINT_NAME,fk.REFERENCED_TABLE_SCHEMA, fk.REFERENCED_TABLE_NAME,t1.ENGINE as source_engine, t2.ENGINE as target_engineFROM information_schema.KEY_COLUMN_USAGE fkJOIN information_schema.TABLES t1ON fk.TABLE_SCHEMA = t1.TABLE_SCHEMA AND fk.TABLE_NAME = t1.TABLE_NAMEJOIN information_schema.TABLES t2ON fk.REFERENCED_TABLE_SCHEMA = t2.TABLE_SCHEMAAND fk.REFERENCED_TABLE_NAME = t2.TABLE_NAMEWHERE fk.REFERENCED_TABLE_NAME IS NOT NULLAND t1.ENGINE != t2.ENGINE;-- 2. Delete invalid foreign keysALTER TABLE table_name DROP FOREIGN KEY constraint_name;-- 3. or recreate the foreign key after unifying the storage engineALTER TABLE table_name ENGINE=InnoDB;
Partitioned tables using engines with non native partitioningProblem | Description |
Engines that support native partitioning | InnoDB, NDB/NDBCLUSTER |
Engines not supported | MyISAM, ARCHIVE, CSV, and so on |
Changes in MySQL 8.0 | Removed the generic partitioning handler |
-- 1. Find tables using non-native partitioningSELECT table_schema, table_name, engineFROM information_schema.tablesWHERE create_options LIKE '%partitioned%'AND UPPER(engine) NOT IN ('INNODB', 'NDB', 'NDBCLUSTER');-- 2. Convert to InnoDBALTER TABLE database_name.table_name ENGINE=InnoDB;-- 3. or remove partitioningALTER TABLE database_name.table_name REMOVE PARTITIONING;
Tables recognized by InnoDB that belong to a different engine-- Complex situations requiring multi-step processing:-- 1. Rename the current tableRENAME TABLE problem_table TO problem_table_temp;-- 2. Create a dummy InnoDB table (with the same structure)CREATE TABLE problem_table (id INT) ENGINE=InnoDB;-- 3. Drop the dummy table (clean up the InnoDB data dictionary)DROP TABLE problem_table;-- 4. Revert the temporary table to its original nameRENAME TABLE problem_table_temp TO problem_table;
Circular directory references in tablespace data file paths/../). This type of path has been disallowed since MySQL 8.0.17.-- 1. Find tablespaces containing circular referencesSELECT FILE_NAMEFROM INFORMATION_SCHEMA.FILESWHERE FILE_TYPE = 'TABLESPACE'AND FILE_NAME LIKE '%/../%'-- 2. Move the data files to a normal path-- Stop MySQL, manually move the files, then update the data dictionary-- or Rebuild tableALTER TABLE table_name ENGINE=InnoDB;
Removed system variables for error logging to the system log configurationRemoved Variables | Alternative Variable |
log_syslog_facility | syseventlog.facility |
log_syslog_include_pid | syseventlog.include_pid |
log_syslog_tag | syseventlog.tag |
log_syslog | No direct alternative; use the log_sink_syseventlog component. |
my.cnf configuration file:# BEFORE MODIFICATION[mysqld]log_syslog=1log_syslog_facility=daemonlog_syslog_tag=mysql# AFTER MODIFICATION[mysqld]# LOAD SYSTEM LOG COMPONENTlog_error_services='log_filter_internal; log_sink_internal; log_sink_syseventlog'# USE NEW VARIABLE NAMESsyseventlog.facility=daemonsyseventlog.tag=mysql
Removed system variablesRemoved Variables | Alternative Solution |
date_format | None. |
datetime_format | None. |
have_crypt | None. |
ignore_builtin_innodb | None. |
ignore_db_dirs | None. |
innodb_checksums | innodb_checksum_algorithm |
innodb_file_format | None (MySQL 8.0 only supports Barracuda) |
innodb_file_format_check | None. |
innodb_file_format_max | None. |
innodb_large_prefix | None (Enabled by default in MySQL 8.0) |
innodb_locks_unsafe_for_binlog | None. |
innodb_stats_sample_pages | innodb_stats_transient_sample_pages |
innodb_support_xa | None (Always enabled in MySQL 8.0) |
innodb_undo_logs | innodb_rollback_segments |
log_warnings | log_error_verbosity |
max_tmp_tables | None. |
metadata_locks_cache_size | None. |
metadata_locks_hash_instances | None. |
old_passwords | None. |
query_cache_limit | None (Query cache has been removed) |
query_cache_min_res_unit | None. |
query_cache_size | None. |
query_cache_type | None. |
query_cache_wlock_invalidate | None. |
secure_auth | None (Always enabled in MySQL 8.0) |
sync_frm | None. |
tx_isolation | transaction_isolation |
tx_read_only | transaction_read_only |
my.cnf configuration file to remove or replace deprecated variables:# BEFORE MODIFICATION[mysqld]query_cache_size=64Mquery_cache_type=1innodb_file_format=Barracudatx_isolation=READ-COMMITTEDlog_warnings=2# AFTER MODIFICATION[mysqld]# Remove query_cache related configurations (Query cache has been removed)# Remove innodb_file_format (8.0 only supports Barracuda)transaction_isolation=READ-COMMITTEDlog_error_verbosity=2
System variables with new default valuesVariable | MySQL 5.7 Default Values | MySQL 8.0 Default Values | Impact |
character_set_server | latin1 | utf8mb4 | Default character set for newly created tables |
collation_server | latin1_swedish_ci | utf8mb4_0900_ai_ci | Default collation for newly created tables |
explicit_defaults_for_timestamp | OFF | ON | TIMESTAMP column behavior |
max_allowed_packet | 4MB | 64MB | Single data packet size limit |
event_scheduler | OFF | ON | Whether the event scheduler is enabled |
log_bin | OFF | ON | Whether binary logging is enabled |
innodb_autoinc_lock_mode | 1 | 2 | Auto-increment lock mode |
innodb_flush_neighbors | 1 | 0 | Refresh adjacent pages |
innodb_max_dirty_pages_pct_lwm | 0 | 10 | Dirty pages low watermark |
innodb_undo_tablespaces | 0 | 2 | Undo tablespace number |
innodb_undo_log_truncate | OFF | ON | Whether Undo logs are truncated |
back_log | -1 | 151 | Connection queue size |
max_error_count | 64 | 1024 | Maximum error count |
optimizer_trace_max_mem_size | 16KB | 1MB | Optimizer trace memory |
my.cnf:[mysqld]# Maintain MySQL 5.7 character set behaviorcharacter_set_server=latin1collation_server=latin1_swedish_ci# Maintain MySQL 5.7 TIMESTAMP behaviorexplicit_defaults_for_timestamp=OFF# Maintain MySQL 5.7 auto-increment lock mode (if there is statement-based replication)innodb_autoinc_lock_mode=1# If binary logging is not requiredskip-log-bin
New default authentication plugin considerationsmysql_native_password to caching_sha2_password, which may cause connection issues for older clients.Problem | Description |
New default plugin | caching_sha2_password |
Old default plugin | mysql_native_password |
Security | caching_sha2_password provides stronger password hashing. |
Compatibility | Old clients/drivers may not support the new plugin. |
# my.cnf[mysqld]default_authentication_plugin=mysql_native_password
-- Create a user using the old pluginCREATE USER 'user'@'host' IDENTIFIED WITH mysql_native_password BY 'password';-- Or modify existing usersALTER USER 'user'@'host' IDENTIFIED WITH mysql_native_password BY 'password';
Level | Description | Processing Requirements |
ERROR | Critical issues must be resolved before upgrading. | Upgrade may fail or cause data unavailability. |
WARNING | Potential issues; it is recommended to resolve them. | Features or performance may be affected post-upgrade. |
NOTICE | Prompt message | The upgrade is not affected, but it is worth noting. |
-- Comprehensive pre-upgrade check script-- Run this script to quickly detect most upgrade issues.-- 1. Check old time formatsSELECT 'Old time format' as check_type, table_schema, table_name, column_nameFROM information_schema.columnsWHERE column_type LIKE '%5.5 binary format%'and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 2. Check the utf8mb3 character setSELECT 'UTF8MB3 character set' as check_type, table_schema, table_name, column_nameFROM information_schema.columnsWHERE character_set_name IN ('utf8', 'utf8mb3') and table_schema not in ('information_schema','mysql','performance_schema','sys')LIMIT 20;-- 3. Check zero date default valuesSELECT 'Zero date default values' as check_type, table_schema, table_name, column_nameFROM information_schema.columnsWHERE column_default LIKE '0000-00-00%' and table_schema not in ('information_schema','mysql','performance_schema','sys')LIMIT 20;-- 4. Check non-InnoDB partitioned tablesSELECT 'Non-native partitioning' as check_type, table_schema, table_name, engineFROM information_schema.tablesWHERE create_options LIKE '%partitioned%'AND UPPER(engine) NOT IN ('INNODB', 'NDB', 'NDBCLUSTER') and table_schema not in ('information_schema','mysql','performance_schema','sys');-- 5. Check the length of foreign key constraint namesSELECT 'Foreign key name too long' as check_type,SUBSTRING_INDEX(id, '/', 1) as db_name,SUBSTRING_INDEX(id, '/', -1) as table_name,LENGTH(SUBSTRING_INDEX(id, '/', -1)) as name_lengthFROM information_schema.innodb_sys_foreignWHERE LENGTH(SUBSTRING_INDEX(id, '/', -1)) > 64;-- 6. Check which tables have undergone Instant DDLSELECT b.name from information_schema.INNODB_SYS_INSTANT_COLS a join information_schema.INNODB_SYS_TABLES b on a.table_id=b.table_id;-- 7. Check which tables have undergone modify columnSELECT b.name from information_schema.INNODB_SYS_INSTANT_MODIFIED_COLS a join information_schema.INNODB_SYS_TABLES b on a.table_id=b.table_id;-- 8. Check orphaned stored proceduresSELECT 'Orphaned stored procedures' as check_type, ROUTINE_SCHEMA, ROUTINE_NAMEFROM information_schema.routinesWHERE NOT EXISTS (SELECT SCHEMA_NAMEFROM information_schema.schemataWHERE ROUTINE_SCHEMA = SCHEMA_NAME);
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback