Mysql prompts Incorrect string value: '\ xF0 \ x9F \ x9B \ xB3 ,... 'For column' option _ value' solution

Source: Internet
Author: User
Tags character set

There was an episode yesterday when the database was restored (it should be three o'clock in the morning:

[Root @ site themes] #/usr/local/mysql/bin/mysql-uweb-p 'admin' web </tmp/web_wp_20160422_687. SQL
Warning: Using a password on the command line interface can be insecure.
ERROR 1366 (HY000) at line 907: Incorrect string value: '\ xF0 \ x9F \ x9B \ xB3,...' for column 'option _ value' at row 1
View the mysql table creation statement:

MySQL


Mysql> show create table web. wp_users \ G
* *************************** 1. row ***************************
Table: wp_users
Create Table: create table 'WP _ users '(
'Id' bigint (20) unsigned not null AUTO_INCREMENT,
'User _ login 'varchar (60) COLLATE utf8mb4_unicode_ci not null default '',
'User _ pass' varchar (255) COLLATE utf8mb4_unicode_ci not null default '',
'User _ nicename 'varchar (50) COLLATE utf8mb4_unicode_ci not null default '',
'User _ email 'varchar (100) COLLATE utf8mb4_unicode_ci not null default '',
'User _ url' varchar (100) COLLATE utf8mb4_unicode_ci not null default '',
'User _ registered' datetime not null default '2017-00-00 00:00:00 ',
'User _ activation_key 'varchar (255) COLLATE utf8mb4_unicode_ci not null default '',
'User _ status' int (11) not null default '0 ',
'Display _ name' varchar (250) COLLATE utf8mb4_unicode_ci not null default '',
Primary key ('id '),
KEY 'user _ login_key '('User _ login '),
KEY 'user _ nicename' ('User _ nicename '),
KEY 'user _ email '('User _ email ')
) ENGINE = MyISAM AUTO_INCREMENT = 2 default charset = utf8mb4 COLLATE = utf8mb4_unicode_ci
Probably because of the character set "utf8mb4" and the problem of restoring the database using the character set twice

Solution:


[Client]
Default-character-set = utf8mb4
[Mysqld]
Character-set-server = utf8mb4
The utf8mb4 character set has many new features. Please Baidu!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.