ERROR 1366 (HY000): Incorrect string value: & #39; \ xC6 \ xF4 \ xD3 \ xC3 & #39; for column & #39; name & #39; at row 1, hy000xc6

Source: Internet
Author: User

ERROR 1366 (HY000): Incorrect string value: '\ xC6 \ xF4 \ xD3 \ xc3' for column 'name' at row 1, hy000xc6
ERROR 1366 (HY000): Incorrect string value: '\ xC6 \ xF4 \ xD3 \ xc3' for column 'name' at row 1

Mysql> status
D: \ mysql6.0 \ bin \ mysql.exe Ver 14.15 Distrib 6.0.11-alpha, for Win64 (unknown)
Connection id: 1
Current database: bank
Current user: root @ localhost
SSL: Not in use
Using delimiter :;
Server version: 6.0.11-alpha-community MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 5 hours 29 min 25 sec
Threads: 1 Questions: 43 Slow queries: 0 Opens: 52 Flush tables: 1 Open tables: 4 Queries per second avg: 0.2

# As shown above, all codes are UTF-8


Mysql> show create table status;
+ -------- + --------------------------------
| Table | Create Table
+ -------- + --------------------------------
| Status | create table 'status '(
'Id' int (11) not null AUTO_INCREMENT,
'Name' varchar (20) default null,
Primary key ('id ')
) ENGINE = InnoDB default charset = utf8 |
The format of the created status table is also utf8.
Insert data:
Mysql> insert into status (name) values ("enabled ");
ERROR 1366 (HY000): Incorrect string value: '\ xC6 \ xF4 \ xD3 \ xc3' for column 'name' at row 1

# Solution:
Mysql> set names gbk;
Query OK, 0 rows affected (0.00 sec)

Mysql> insert into status (name) values ("enabled ");

Query OK, 1 row affected (0.06 sec)


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.