I have a local webserver running on my pc to which I use for local development. I'm now at the stage of exporting the database and importing onto my hosted VPS.
When exporting then importing I get the following error!
1115 - Unknown character set: 'utf8mb4'
Can somebody point me in the right direction?
Sometimes I get similar problems while using HeidiSQL which by default exports in utf8mb4 character encoding. Not all MySQL installations support this encoding and importing such data leads to similar error messages. My workaround then is to export data using phpMyAdmin, which exports in utf8. There are problably other tools and possible ways like manually editing dump file, converting it from utf8mb4 to utf8 (if needed) and changing
SET NAMES utf8mb4
toSET NAMES utf8
. Utf8mb4 is a superset of utf8, so if you're absolutely sure, that your data is just utf8, then you can simply changeSET NAMES
in dump file toutf8
.This helped me
Open sql file by text editor find and replace all
Import again.
The error clearly states that you don't have
utf8mb4
supported on your stage db server.Cause: probably locally you have
MySQL
version5.5.3
or greater, and on stage/hosted VPS you haveMySQL
server version less then5.5.3
The utf8mb4 character sets was added in MySQL 5.5.3.
Solution 1: Simply upgrade your MySQL server to 5.5.3 (at-least) - for next time be conscious about the version you use locally, for stage, and for prod, all must have to be same. A suggestion - in present the default character set should be
utf8mb4
.Solution 2 (not recommended): Convert the current character set to
utf8
, and then export the data - it'll load ok.