Importing a mysqlnd (5.0.12) database to MySQL server (5.1.66) causes error? Currently we are performing this task and encountering errors (like below):
ERROR 1146 (42S02): Table 'xx-xxx-xxx-xxx' doesn't exist
ERROR 1273 (HY000): Unknown collation: 'utf8mb4_unicode_ci'
ERROR 1115 (42000): Unknown character set: 'utf8mb4'
2 Answers 2
The cause of the problems may be that the utf8mb4
character set has been added in Mysql 5.5.3.
You need to upgrade MySQL server or change your data to working with utf
without mb4. Here you can find some tips how to do it
-
but there is no mention of 5.5.3 version in my question. the source and target db versions are different from 5.5.3Zakir HC– Zakir HC2016年03月08日 09:34:32 +00:00Commented Mar 8, 2016 at 9:34
-
if in source file this collation - You wrong about source version :-) or it was error when export (not sure how You do the export)a_vlad– a_vlad2016年03月08日 09:55:09 +00:00Commented Mar 8, 2016 at 9:55
-
1mysqlnd is a client library. Character set support is primarily a server feature. You have to check which server you used. MySQL 5.1 also is a very old version which is out of support or more than a year. 5.7 is current.johannes– johannes2016年03月08日 12:04:01 +00:00Commented Mar 8, 2016 at 12:04
in additional to the answer about support utf8mb4 from MySQL 5.5,
the problem with collation You can resolve by edit(replace) all utf8mb4 to other utf collation. If file huge, You can use sed command for change string without open the file -
sed -i -- 's/utf8mb4/utf/g' file.sql
for ERROR 1146 (42S02): Table 'xx-xxx-xxx-xxx' doesn't exist - not all sql dump include create table instructions, best choice check the text of script, again if file huge - use
cat file.sql | grep -E 'xx-xxx-xxx-xxx' | grep -E 'CREATE'
for check is it include in script or not