mysql "COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'utf8mb4'"

thtygnil  于 2022-12-22  发布在  Mysql
关注(0)|答案(3)|浏览(590)

I am not an expert in mysql I have looked in other posts for the solution to this problem but I cannot solve it, could someone help me to solve this problem?
I'm migrating a web and when I import the database I get this error.
thanks a lot

jqjz2hbq

jqjz2hbq1#

You can change the collation of the database(where you are importing) to utf8mb4
See here

apeeds0o

apeeds0o2#

This question has already been answered here: I have that error"#1273 - Unknown collation: 'utf8mb4_0900_ai_ci'"
NOTE: COLLATE=utf8mb4_0900_ai_ci replace with COLLATE=utf8mb4_general_ci

a11xaf1n

a11xaf1n3#

I found it very easy fix. Make sure you backup your database before, just in case you need to change to another collation. Go to PHPMYADMIN, select the database, and hit OPERATIONS, there at the end, find COLLATION select a collation what will work for you 'utf8mb4_unicode_ci' for example, then check both 'Change all tables collations' and 'Change all tables columns collations' hit GO. My database worked perfectly.

相关问题