This topic describes how to upgrade the major engine version of an ApsaraDB RDS for MySQL instance. You can upgrade the major engine version in the ApsaraDB RDS console or create an RDS instance that runs the required major engine version and use Data Transmission Service (DTS) to migrate data from the original RDS instance to the new one.
ApsaraDB RDS for MySQL does not support downgrading the major engine version in the ApsaraDB RDS console. You can create an RDS instance that runs the required major engine version, use DTS to migrate the data of the original RDS instance to the new RDS instance, and then release the original RDS instance after you verify that the new RDS instance runs as expected.
Select an upgrade method
Method 1: Upgrade the major engine version in the ApsaraDB RDS console and Method 2: Upgrade the major engine version in the DTS console support all MySQL version upgrades, including upgrades from MySQL 5.5 to MySQL 5.6, from MySQL 5.6 to MySQL 5.7, and from MySQL 5.7 to MySQL 8.0. Before you upgrade the major engine version of your RDS instance, select an upgrade method based on your business requirements:
If your RDS instance belongs to one of the following four types and meets the requirements of the type, we recommend that you use Method 1: Upgrade the major engine version in the ApsaraDB RDS console.
Cluster Edition (enhanced SSDs or standard SSDs)
MySQL Group Replication (MGR) limitation: You cannot upgrade the major engine version of an RDS instance that uses MySQL Group Replication (MGR).
Database proxy limitation (if applicable): The minor version of the database proxy must be 1.13.41 or later.
Instance status limitation: The RDS instance must be in the Running state. The primary and secondary nodes must be healthy and have no replication latency.
Storage engine limitation: The database and all tables must use the InnoDB storage engine.
The RDS instance does not use phased-out instance types.
High-availability Edition (enhanced SSDs or standard SSDs)
Database proxy limitation (if applicable): The minor version of the database proxy must be 1.13.41 or later.
Instance status limitation: The RDS instance must be in the Running state. The primary and secondary nodes must be healthy and have no replication latency.
Storage engine limitation: The database and all tables must use the InnoDB storage engine.
The RDS instance does not use phased-out instance types.
High-availability Edition (local SSDs)
Encryption limitation: Transparent data encryption (TDE) is not enabled. TDE cannot be disabled after it is enabled. If TDE is enabled, you must use Method 2: Upgrade the major engine version in the DTS console.
Database proxy limitation (if applicable): The minor version of the database proxy must be 1.13.41 or later.
Instance status limitation: The RDS instance must be in the Running state. The primary and secondary nodes must be healthy and have no replication latency.
Table quantity limitation: The number of tables cannot exceed 1,000,000.
Storage engine limitation: The database and all tables must use the InnoDB storage engine.
Instance type limitation: The major engine version to which you want to upgrade must support the instance type of the original RDS instance (including the primary RDS instance and read-only RDS instances). The instance type must not be phased out. For more information, see Primary ApsaraDB RDS for MySQL instance types.
Basic Edition (enhanced SSDs or standard SSDs)
Instance status limitation: The RDS instance must be in the Running state.
Storage engine limitation: The database and all tables must use the InnoDB storage engine.
The RDS instance does not use phased-out instance types.
If your RDS instance does not belong to any of the preceding four types or TDE is enabled, use Method 2: Upgrade the major engine version in the DTS console.
If your RDS instance belongs to one of the preceding four types but does not meet the requirements of the type, you can modify the configuration of the RDS instance based on the following table and then use Method 1: Upgrade the major engine version in the ApsaraDB RDS console or Method 2: Upgrade the major engine version in the DTS console.
Issue
Solution
The RDS instance is in another state, such as Restarting.
Upgrade the major engine version after the ongoing task is complete.
The number of tables in the RDS instance that uses local SSDs and runs High-availability Edition exceeds 1,000,000.
Delete redundant tables before you upgrade the major engine version.
Specific databases and tables do not use InnoDB.
Run the
ALTER TABLE engine=InnoDB;
command to convert the storage engine to InnoDB.The RDS instance uses a phased-out instance type.
Change the instance type before you upgrade the major engine version. For more information, see Change the specifications of an ApsaraDB RDS for MySQL instance.
The database proxy version does not meet the requirements.
Upgrade the minor version of the database proxy to 1.13.41 or later. For more information, see Upgrade the minor version of the database proxy.
The RDS instance uses standard SSDs.
Upgrade the standard SSDs to enhanced SSDs and then upgrade the major engine version.
For more information about how to upgrade the major engine version of an RDS instance that runs a different database engine, see the following topics:
Method 1: Upgrade the major engine version in the ApsaraDB RDS console
Preparations
Understand the differences and advantages between the original and new major engine versions
Upgrade from MySQL 5.6 to MySQL 5.7: For more information about the differences between MySQL 5.6 and MySQL 5.7, see Appendix 4: Differences between MySQL 5.6 and MySQL 5.7. For more information about the advantages of MySQL 5.7 over MySQL 5.6, see Appendix 2: Advantages of MySQL 5.7 over MySQL 5.6.
Upgrade from MySQL 5.7 to MySQL 8.0: For more information about the differences between MySQL 5.7 and MySQL 8.0, see Appendix 3: Differences between MySQL 5.7 and MySQL 8.0. For more information about the advantages of MySQL 8.0 over MySQL 5.7, see Appendix 1: Advantages of MySQL 8.0 over MySQL 5.7.
Understand the upgrade process and impacts
Version span limitation: You cannot skip a major engine version when you upgrade the major engine version of your RDS instance. By default, the system upgrades the major engine version of your RDS instance to the most recent minor engine version of the required major engine version. For example, if you want to upgrade the major engine version from MySQL 5.6 to MySQL 8.0, you must upgrade the major engine version from MySQL 5.6 to MySQL 5.7 and then to MySQL 8.0.
Downgrade limitation: You cannot downgrade the major engine version in the ApsaraDB RDS console. You can create an RDS instance that runs the required major engine version, use DTS to migrate the data of the original RDS instance to the new RDS instance, and then release the original RDS instance after you verify that the new RDS instance runs as expected.
Upgrade process for RDS instances that use local SSDs: The system first upgrades the secondary RDS instance. After the upgrade is complete, the system performs a primary/secondary switchover and then upgrades the primary RDS instance. During the upgrade, your workloads are interrupted for 30 seconds to 1 minute. We recommend that you perform the upgrade during off-peak hours.
Upgrade process for RDS instances that use enhanced SSDs: If your RDS instance uses ESSDs, the system creates an RDS instance and upgrades the major engine version of the new RDS instance to the required version. Then, the system switches your workloads over from the original RDS instance to the new RDS instance. During the upgrade, your workloads are interrupted for 30 seconds to 1 minute. We recommend that you perform the upgrade during off-peak hours.
Check the instance and database configurations
Check reserved keywords: Check your user-defined functions to make sure that they do not use reserved keywords.
Check full backups: Check whether a full backup was created within the last week. If necessary, create a full backup.
Check the automatic reconnection mechanism: During the upgrade, ApsaraDB RDS performs a switchover. We recommend that you perform the upgrade during off-peak hours or make sure that your application has an automatic reconnection mechanism. For more information about the impacts of a switchover, see Impacts of a primary/secondary switchover.
Check the free space: Before the upgrade, make sure that your RDS instance has sufficient free space. We recommend that you reserve at least 10 GB of free space.
Adjust the cleanup policy: Increase the local log retention period and the maximum storage usage. For more information, see Modify the local log policy.
Back up instance parameters: To ensure the stability and performance of MySQL in the new major engine version, ApsaraDB RDS does not allow you to view or modify some parameters that are deprecated in the new major engine version after the upgrade. Before you upgrade the major engine version of your RDS instance, we recommend that you back up the modification records of related parameters for subsequent operations and auditing.
If you want to upgrade the major engine version from MySQL 5.6 to MySQL 5.7 or from MySQL 5.7 to MySQL 8.0, check the following items:
Upgrade from MySQL 5.6 to MySQL 5.7
Check full-text indexes and version information: If your RDS instance runs MySQL 5.6 and a minor engine version earlier than 20221130, the full-text index is created in the system tablespace for the RDS instance. After you upgrade the major engine version of the RDS instance to MySQL 5.7, the tablespace may be damaged. If your RDS instance runs MySQL 5.6 and an earlier minor engine version, update the RDS instance to the most recent minor engine version before you upgrade the major engine version. For more information, see FAQ.
Upgrade from MySQL 5.7 to MySQL 8.0
Check feature compatibility: If the stored procedures, triggers, views, or functions in your database contain features that are not supported in MySQL 8.0, modify them before the upgrade. Otherwise, the upgrade fails.
Check system table dependencies: Check whether your workloads depend on MySQL 5.7 system tables in the sys, mysql, information_schema, and performance_schema databases. Some system tables in MySQL 5.7 are changed in MySQL 8.0. For example, some tables are removed, and the names or structures of some tables are changed. If your workloads depend on these changed tables, errors may occur.
Check data type compatibility: ApsaraDB RDS for MySQL 8.0 no longer supports some data types that are supported in earlier versions. If the fields in your tables use data types that are not supported in MySQL 8.0, you must fix the issue before the upgrade by using the
REPAIR TABLE
statement or by exporting and importing the data. For more information, see Preparing Your Installation for Upgrade.Check the values of the
comment
attribute: MySQL 8.0 with a minor engine version of 20221231 or later introduces theloose_upgrade_clear_invalid_comment
parameter. If this parameter is set toON
(default), the system automatically clears garbled characters in the comments of tables, fields, and indexes during the upgrade to prevent upgrade failures. Therefore, you must check whether the values of thecomment
attribute in your database tables contain garbled characters before the upgrade. If garbled characters exist, thecomment
attribute is cleared.Check stored procedures: If the stored procedures or functions in your database contain garbled characters, fix the issue before the upgrade to prevent upgrade failures.
Check the time data types in MySQL 5.5 or earlier: If your database contains tables that use time data types in MySQL 5.5 or earlier, you must rebuild the tables before you upgrade the major engine version to MySQL 8.0. Otherwise, the upgrade fails.
Run the following SQL statements to check whether your RDS instance contains tables that use time data types in MySQL 5.5 or earlier:
# Display old time data types SET SESSION show_old_temporals= ON; # Query tables that contain old time data types SELECT TABLE_NAME, COLUMN_NAME, COLUMN_TYPE FROM information_schema.columns WHERE COLUMN_TYPE IN ("time /* 5.5 binary format */ ", "timestamp /* 5.5 binary format */", "datetime /* 5.5 binary format */ ");
If your tables contain time data types in MySQL 5.5 or earlier, run the following command to rebuild the table structures:
# Rebuild tables ALTER TABLE FORCE;
Test and simulate the upgrade
Syntax test: Before the upgrade, we recommend that you create an RDS instance that runs the required major engine version and test the syntax to avoid issues that may occur because the syntax or features in the original major engine version are not supported in the new major engine version.
Upgrade simulation: Before the upgrade, we recommend that you clone the original RDS instance, upgrade the major engine version of the cloned RDS instance, and then upgrade the major engine version of the original RDS instance after you confirm that all features run as expected on the cloned RDS instance.
Post-upgrade considerations
Restore the original RDS instance: You can use backups of the original RDS instance to restore the original RDS instance. This feature is not supported for RDS instances that use local SSDs.
Restore the new RDS instance: You cannot use backups of the original RDS instance to restore the new RDS instance. If you want to restore the new RDS instance, you must use backups that are created after the upgrade.
Operations
Select an upgrade method based on the upgrade scenario:
Upgrade method | Upgrade scenario |
Perform a pre-check and upgrade |
|
Direct upgrade |
|
Perform a pre-check and upgrade
Visit the ApsaraDB RDS console, select a region at the top of the page, and then click the ID of the RDS instance.
In the left-side navigation pane, click Major Engine Version Upgrade to go to the Pre-check page.
From the drop-down list on the right side of Select Upgrade Version, select the major engine version to which you want to upgrade and click Create Upgrade Check Report. For more information about the report, see Description of the major engine version upgrade check report.
After the check is complete and you confirm that the upgrade does not pose risks, click the Upgrade Instance tab.
From the drop-down list on the right side of Select Upgrade Version, select the major engine version to which you want to upgrade and click Upgrade Instance.
In the Major Engine Version Upgrade dialog box, confirm the major engine version to which you want to upgrade, select a Switch Time, and then click Upgrade Now.
Direct upgrade
Visit the ApsaraDB RDS console, select a region at the top of the page, and then click the ID of the RDS instance.
In the section, click Upgrade Engine Version.
NoteIf you cannot find this button, check whether your RDS instance meets the upgrade requirements.
In the dialog box that appears, select Switch Immediately or Switch Within Maintenance Window and click OK.
Switch Immediately: The upgrade immediately starts.
Switch Within Maintenance Window: The upgrade is performed during the maintenance window. You can also click Maintenance Window and then Configure on the right to modify the maintenance window.
NoteDuring the upgrade, the status of the RDS instance is Migrating Version.
Method 2: Upgrade the major engine version in the DTS console
If the major engine version of your RDS instance cannot be upgraded in the ApsaraDB RDS console, you can create a RDS instance that runs the required major engine version and a DTS data migration task and then migrate the data of the original RDS instance to the new RDS instance to upgrade the major engine version.
Example: You have an RDS instance that runs MySQL 5.7 and has TDE enabled. The major engine version of the RDS instance cannot be directly upgraded in the ApsaraDB RDS console. In this case, you can create an RDS instance that runs MySQL 8.0, migrate the data of the original RDS instance to the new RDS instance, and then release the original RDS instance.
After the upgrade, you must verify that the new major engine version is compatible with your workloads and monitor the new RDS instance for a period of time. After you confirm that your workloads run as expected on the new RDS instance, you can release your original RDS instance.
Appendix 1: Advantages of MySQL 8.0 over MySQL 5.7
The security of your database system is enhanced. You can manage accounts in a more flexible manner.
You can create and manage resource groups.
The features of the InnoDB storage engine are enhanced.
New character sets, data types, and syntax are supported. Backup locks and optimizer_switch flags are introduced.
JSON and XML expressions are enhanced.
Optimizers are enhanced.
Replication performance is enhanced.
Multi-value indexes can be created. Derived condition pushdown is optimized.
MySQL grant tables can be read.
Resource allocation control is supported.
Appendix 2: Advantages of MySQL 5.7 over MySQL 5.6
New features such as password management, account locking, and connection encryption are introduced. These new features help improve the security of your database system.
Online DDL operations are supported. For example, you can use the RENAME INDEX clause to rename an index.
The scalability of the InnoDB storage engine and the performance of temporary InnoDB tables are optimized to increase data loading speeds.
The JSON format is supported.
Index Condition Pushdown (ICP) is supported for partitioned tables, and spatial indexes are supported for InnoDB tables.
Most of the used parsers, optimizers, and cost models are optimized to improve the maintainability, scalability, and performance of your database system.
New character sets are supported. These include the gb18030 character set that is defined in the Chinese National Standard GB 18030-2005: Information technology - Chinese coded character set.
A built-in ngram full-text parser plug-in that supports Chinese, Japanese, and Korean (CJK) is provided.
Dump threads on primary RDS instances are optimized to reduce lock contention and increase throughput.
The replication latency is significantly reduced.
The sys system database is added to support multiple monitoring metrics. These metrics help you reduce the storage usage and improve the ease of use.
Appendix 3: Differences between MySQL 5.7 and MySQL 8.0
The following table lists only some important differences between MySQL 5.7 and MySQL 8.0. For more information about the differences between other versions, see MySQL Release Notes.
Feature | 5.7 | 8.0 |
GRANT ... IDENTIFIED BY PASSWORD syntax | Supported | Not supported |
PASSWORD() function | Supported | Not supported |
FLUSH QUERY CACHE and RESET QUERY CACHE syntax | Supported | Not supported |
Parameters of the SQL_MODE system variable: DB2, MAXDB, MSSQL, MYSQL323, MYSQL40, ORACLE, POSTGRESQL, NO_FIELD_OPTIONS, NO_KEY_OPTIONS, and NO_TABLE_OPTIONS | Supported | Not supported |
Automatic sorting by default for GROUP BY syntax | Supported | Not supported |
Syntax that contains the EXTENDED or PARTITIONS keyword | Supported | Not supported |
Encryption functions such as ENCODE(), DECODE(), and ENCRYPT() | Supported | Not supported |
Spatial analysis functions | Supported | Not supported |
Functions that previously accepted either well-known binary (WKB) strings or geometry arguments but no longer accept geometry arguments | Supported | Not supported |
Parsing of \N as NULL | Supported | Not supported |
PROCEDURE ANALYSE() function | Supported | Not supported |
Creation of partitioned tables by using the NDB storage engine | Supported | Not supported |
Compression of temporary tables by using the InnoDB storage engine | Supported | Not supported |
JSON_APPEND() function | Supported | Not supported |
Placing of table partitions in shared tablespaces | Supported | Not supported |
ALTER TABLE ... UPGRADE PARTITIONING syntax | Supported | Not supported |
Appendix 4: Differences between MySQL 5.6 and MySQL 5.7
The following table lists only some important differences between MySQL 5.6 and MySQL 5.7. For more information about the differences between other versions, see MySQL Release Notes.
Feature | 5.6 | 5.7 |
CREATE...AS SELECT when the GTIDs feature is enabled | Supported | Not supported |
Usage of temporary tables when the GTIDs feature is enabled | Supported | Not supported |
Configuration of partition keys in partitioned tables | Supported | Not supported |
ENGINE_NO_CACHE syntax | Supported | Not supported |
Invisible indexes | Supported | Not supported |
UPDATE non_affected_rows INSERT syntax | Supported | Not supported |
Proxy-related commands | Supported in SET command mode | Supported in Call Procedure mode |
TokuDB, Sphinx, RocksDB, and MEMORY storage engines | Supported | Not supported |
str_ord() function | Supported | Not supported |
raiseerror() function | Supported | Not supported |
OPTIMIZE TABLE table ASYNC | Supported | Not supported |
ENGINE_NO_CACHE | Supported | Not supported |
INFORMATION.TABLE_UTILIZATION table | Supported | Not supported |
The requesting_thd_id and blocking_thd_id columns in the INFORMATION_SCHEMA.INNODB_LOCK_WAITS table | Supported | Not supported |
INFORMATION_SCHEMA.INNODB_RSEG table | Supported | Not supported |
INFORMATION_SCHEMA.INNODB_IO_STATUS table | Supported | Not supported |
Column compression | Supported | Not supported |
Query Plan Cache | Supported | Not supported |
Limit + Union syntax | Parentheses () not required | Parentheses () required |
SHOW FULL PROCESSLIST syntax | The memory and query_memory columns are removed from the result returned by MySQL 5.7. | |
max_statement_time and max_execution_time | MySQL 5.7 removes max_statement_time and retains only max_execution_time. | |
RDS_SQL_MAX_AFFECTED syntax | MySQL 5.7 no longer supports using RDS_SQL_MAX_AFFECTED to limit the number of records affected by a single UPDATE or DELETE statement. The rds_sql_max_affected_rows variable is used for control. | |
Performance optimization and adjustment for concurrency control | The following parameters for concurrency control are no longer available in MySQL 5.7:
| |
Variables used to specify the number of connections | The following variables are deleted from MySQL 5.7:
| |
Replication-related adjustments |
| |
Log-related adjustments | Adjustments to error logs in MySQL 5.7:
| |
Before version 5.6.4, old time data types did not support microseconds. | Time data types support microsecond precision. Important During the upgrade from MySQL 5.6 to MySQL 5.7, the system detects and rebuilds tables that contain fields with old time data types. This slows down the upgrade process. |
Appendix 5: Differences between MySQL 5.5 and MySQL 5.6
The following table lists only some important differences between MySQL 5.5 and MySQL 5.6. For more information about the differences between other versions, see MySQL 5.6 Reference Manual.
Feature | MySQL 5.5 | MySQL 5.6 |
Full-text index | Not supported | Supported |
InnoDB online DDL | Not supported | Partially supported |
REDO | Maximum support for 4 GB | Maximum support for 512 GB |
Dirty page flushing | Single thread | Separate flushing thread |
purge | Single thread | Multiple threads |
EXCHANGE PARTITION | Not supported | Supported |
Explicit partition specification in DML | Not supported | Supported |
INFORMATION_SCHEMA | MySQL 5.6 provides more information about the buffer pool, tables, indexes, fields, and other metadata. | |
PERFORMANCE_SCHEMA | MySQL 5.6 adds more monitoring information and viewing formats to Performance Schema. | |
Replication | The replication enhancements and changes in MySQL 5.6 include the following:
Important After the upgrade from MySQL 5.5 to MySQL 5.6, the system automatically switches to GTID-based replication mode. | |
Optimizer | MySQL 5.6 enhances optimizer capabilities, including the following:
| |
Not supported | Supported | |
Not supported | Supported | |
Not supported | Supported | |
Not supported | Supported | |
Not supported | Supported |
FAQ
Q: Why does a switchover occur during the upgrade? Are there other serious risks?
A: To ensure business stability, if your RDS instance uses local SSDs, the system first upgrades the secondary RDS instance. After the upgrade is complete, the system automatically switches your workloads over to the secondary RDS instance. If your RDS instance uses ESSDs, the system creates an RDS instance and upgrades the major engine version of the new RDS instance to the required version. Then, the system switches your workloads over from the original RDS instance to the new RDS instance. The major engine version upgrade does not cause other serious risks. For more information about the impacts of a primary/secondary switchover, see Impacts of a primary/secondary switchover.
Q: Are the primary and secondary RDS instances upgraded together?
A: If your RDS instance uses local SSDs, the system first upgrades the secondary RDS instance and then upgrades the primary RDS instance.
Q: How do I upgrade an RDS instance that runs MySQL 5.7 on RDS Basic Edition with standard SSDs?
A: You cannot directly upgrade the major engine versions of RDS instances that run MySQL 5.7 on RDS Basic Edition with standard SSDs. If you want to upgrade such an RDS instance, you must first change the storage type from standard SSDs to enhanced SSDs and then upgrade the major engine version.
Q: Are parameter templates retained before and after the major engine version upgrade?
A: The answer varies. Assume that you want to upgrade the major engine of your RDS instance from MySQL 5.7 to MySQL 8.0. If the RDS instance uses the system parameter template before the upgrade, the RDS instance will use the system parameter template that corresponds to the original template after the upgrade. For example, if the RDS instance uses the MySQL_InnoDB_5.7_RDS High-availability Edition_High-performance parameter template, the RDS instance will use the MySQL_InnoDB_8.0_RDS High-availability Edition_High-performance parameter template after the upgrade. If the RDS instance uses a custom parameter template before the upgrade, the RDS instance cannot use the template after the upgrade because the template is not retained.
Q: Can I change the configuration of my RDS instance during the major engine version upgrade?
A: You cannot change the configuration items of your RDS instance when you upgrade the major engine version of the RDS instance. You can perform other operations on your RDS instance only after the major engine version is upgraded.
Q: Does the major engine version support automatic upgrade?
A: No, the major engine version of your RDS instance does not support automatic upgrade.
Q: Does the major engine version support downgrade?
A: You cannot downgrade the major engine version in the ApsaraDB RDS console. You can create an RDS instance that runs the required major engine version and use DTS to migrate the data of the original RDS instance to the new RDS instance. After the migration is complete, you can release the original RDS instance. For more information, see Migrate data between ApsaraDB RDS for MySQL instances.
Q: When I upgrade the major engine version from MySQL 5.6 to MySQL 5.7 or from MySQL 5.7 to MySQL 8.0, the upgrade fails and the system displays the error message "The current instance has a full-text index and a minor engine version earlier than 20221130. Upgrade the minor engine version first and then delete and recreate the full-text index" or "The current instance contains a full-text index created in the system tablespace. Delete and recreate the full-text index before you upgrade the major engine version." What are the cause and solution of the error?
A: The following list describes the cause and solution of the error:
Cause
If your RDS instance runs MySQL 5.6 and an earlier minor engine version, the full-text index is created in the system tablespace for the RDS instance due to history reasons. After you upgrade the major engine version of the RDS instance from MySQL 5.6 to MySQL 5.7 or MySQL 8.0, the full-text index that is created in the system tablespace may cause tablespace damage. Therefore, you must delete the full-text index before the upgrade to avoid issues such as data corruption and inaccessibility.
NoteThe preceding issues are fixed for RDS instances that run MySQL 5.6 and a minor engine version of 20221130, and the full-text indexes are created in a separate tablespace for the RDS instances.
Solution
ImportantIf your RDS instance runs MySQL 5.6, upgrade the major engine version of the RDS instance to MySQL 5.7 or make sure that the RDS instance runs a minor engine of 20221130 or later. In this case, the full-text index is not created in the system tablespace for the RDS instance.
Delete the FTS index created in the system tablespace based on the table name.
# Delete the full-text index ALTER TABLE $table_name DROP INDEX $fts_name;
Recreate the FTS index.
# Recreate the full-text index ALTER TABLE $table_name ADD FULLTEXT INDEX $fts_name;
Execute the following SQL statement to query the full-text index created for your RDS instance. If no full-text index created in the system tablespace is returned, the upgrade of the major engine version from MySQL 5.6 to MySQL 5.7 does not fail due to the full-text index created in the system tablespace.
# Query the full-text index created in the system tablespace SELECT NAME FROM information_schema.INNODB_SYS_TABLES WHERE TABLE_ID IN ( SELECT CONV(SUBSTRING_INDEX(SUBSTRING_INDEX(NAME, '_', -4),'_', 1),16,10) FROM INNODB_SYS_TABLES WHERE NAME LIKE '%fts_00000000%' AND SPACE = 0);
Q: When I upgrade the major engine version from MySQL 5.7 to MySQL 8.0, the system displays the error message
267 - Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='
. How do I resolve this issue?A: Check the character set and collation in MySQL. If you are using utf8mb4_general_ci, we recommend that you change it to utf8mb4_0900_ai_ci by using the following SQL statements.
# Modify the character set and collation of a database ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci; # Modify the character set and collation of a table ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; # Modify the character set and collation of a field ALTER TABLE table_name CHANGE column_name column_name type CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
In MySQL 5.7, tables created with the utf8mb4_general_ci collation will default to using utf8mb4_0900_ai_ci as the collation when upgraded to MySQL 8.0. If you compare a column using utf8mb4_general_ci with a column using utf8mb4_0900_ai_ci in a query, MySQL will not be able to handle these two different collations, resulting in a fault.
Q: Is the interruption time 30 seconds to 1 minute regardless of whether read-only RDS instances exist?
A: Yes, we recommend that you perform the upgrade during off-peak hours.
API references
API operation | Description |
Upgrade the major engine version of an ApsaraDB RDS for MySQL instance | Upgrades the major engine version of an ApsaraDB RDS instance. |