Unable to use mysql.rds_set_external_master in MySQL 8

0

We have a MySQL 8.0.28 RDS instance. It was originally MySQL 5.6 (may have been MySQL 5.5 also, I do not remember exactly) which was upgraded to 8.0 in multiple steps as and when new MySQL versions were released. We want to create a replica of this in another AWS account.

We created a snapshot, transferred it to the other account and started a new instance from the snapshot there. We then tried to connect that new instance to the primary db using mysql.rds_set_external_master. However, a call to this fails with the message ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation 'regexp_like' The exact same steps were working fine when we were on MySQL 5.7.

The following information may be helpful:

mysql> show variables like "%collation%";
+-------------------------------+--------------------+
| Variable_name                 | Value              |
+-------------------------------+--------------------+
| collation_connection          | utf8mb4_unicode_ci |
| collation_database            | utf8mb4_unicode_ci |
| collation_server              | utf8mb4_unicode_ci |
| default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci |
+-------------------------------+--------------------+
4 rows in set (0.00 sec)
mysql> SHOW PROCEDURE STATUS LIKE 'rds_set_external_master'\G
*************************** 1. row ***************************
                  Db: mysql
                Name: rds_set_external_master
                Type: PROCEDURE
             Definer: rdsadmin@localhost
            Modified: 2022-04-05 04:57:07
             Created: 2022-04-05 04:57:07
       Security_type: DEFINER
             Comment: 
character_set_client: utf8mb4
collation_connection: utf8mb4_0900_ai_ci
  Database Collation: utf8mb4_unicode_ci
1 row in set (0.00 sec)

Any ideas on how we can fix this error and create the replica in another account will be appreciated.

NikhilC
asked 2 years ago923 views
2 Answers
0

I have the same (or similar) issue. The interesting part here is that WE ARE ABLE to run native mysql replication from aurora with mysql 5.7 to rds with mysql 8.0.36, but we are unable to replicate from aurora 5.7 to aurora serverless with mysql 8 and even from the rds with mysql 8.0.36 to aurora serverless with mysql 8. we're getting the same error message ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation 'regexp_like' while running mysql.rds_set_external_master. any ideas what could cause aurora replication to not work?

whaat is interesting here is that none of the tables/columns/views in the migrated schema use the utf8mb4_0900_ai_ci collation. It looks like only internal mysql tables use this collation.

EDIT: looks like the problem was with aurora 3.05.2. After upgrading to Aurora 3.06.0 it started working.

profile picture
answered 19 days ago
-1

Hi I understand that you receiving this error message "ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation 'regexp_like " this error usually occurs when MySQL tries to compare or operate with two data columns that different collation.

This is not caused by RDS but is a limitation of MySQL I recommend you to take a look at this third party document [1] on steps that can help resolve the issue. However, It is recommended to try any steps in the third party document in a staging environment before applying them on production" Please consider raising a ticket with AWS Support [2] so they can provide further assistance with this issue.

References links

[1] Third party Document - https://askubuntu.com/questions/1383077/1267-illegal-mix-of-collations-utf8mb4-0900-ai-ci-coercible-and-latin1-swe

[2] AWS support - https://aws.amazon.com/contact-us/

steven
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions