M
M
Maxim Oleynik2015-07-17 09:21:35
MySQL
Maxim Oleynik, 2015-07-17 09:21:35

How to convert MySQL database of Wordpress site from utf8mb4_general_ci to utf8_general_ci?

I decided to move the sites to another VDS hosting. When trying to export the database, it gives an error:

Error
SQL query:
--
-- Database: `movnum_me`
--
-- ------------------------------- ------------------------
--
-- `wp_aiowps_events` table structure
--
CREATE TABLE IF NOT EXISTS `wp_aiowps_events` (
`id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT ,
`event_type` VARCHAR( 150 ) NOT NULL DEFAULT '',
`username` VARCHAR( 150 ) DEFAULT NULL ,
`user_id` BIGINT( 20 ) DEFAULT NULL ,
`event_date` DATETIME NOT NULL DEFAULT '0000-00 -00 00:00:00',
`ip_or_host` VARCHAR( 100 ) DEFAULT NULL ,
`referer_info` VARCHAR( 255 ) DEFAULT NULL ,
`url` VARCHAR( 255 ) DEFAULT NULL ,
`event_data` LONGTEXT,
PRIMARY KEY ( `id` )
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 AUTO_INCREMENT =1;
MySQL Answer: Documentation
#1115 - Unknown character set: 'utf8mb4'

I googled and figured out that the problem is in the utf8 mb4 _general_ci encoding, it is not supported by MySQL versions before 5.5. On new hosting MySQL 5.1.69. Hence, I need to somehow convert the database from utf8mb4_general_ci to utf8_general_ci. How can I do that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2015-07-17
@MaximOleynik

1. leave this hosting nafig. Having less than 5.5 sucks imho
2. if you really need it - open your dump with any text editor and replace the line "CHARSET = utf8mb4" with "CHARSET = utf8"

I
Igor Vorotnev, 2015-07-17
@HeadOnFire

Are you joking? VDS is a virtual server, not shared hosting. One of the main charms of VDS / VPS is the ability to install the necessary software and update it to any version. Just upgrade MySQL. If on this VDS you do not have access to this, then what kind of service is this? +1 to Dmitry Entelis - get out of there.
And another hint - if you do not switch, but use regular utf8 - disable Emoji . They are the ones who need mb4 in the first place, and since you will not use them, disable their support so that WordPress does not shove unnecessary scripts and styles into your pages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question