Cannot I store varchar data in a mysql data table in Chinese? What should I do?

Source: Internet
Author: User
Cannot I store varchar data in a mysql data table in Chinese? INSERTINTO 'phptest '. 'usermanage' ('id', 'username', 'password', 'Email ', 'Image', 'Question', varchar (255) 'anser ', 'Sex', 'brithday', 'fromwh mysql data table varchar data cannot store Chinese characters?
Insert into 'phptest'. 'usermanage '(

'Id ',
'Username ',
'Password ',
'Email ',
'Image ',
'Question ', // varchar (255)
'Anser ',
'Sex ',
'Brithday ',
'Fromwhere ', // varchar (255)
'Web ',
'QQ ',
'MSN ',
'Icq ',
'Yahoo ',
'Wangwang', // varchar (255)
'Pay ',
'Info', // varchar (255)
'Lock'
)
VALUES (
'2', 'waterboy ', '000000', [email protected]', 'http: // www.sowa.cn/face/01.gif ', 'Who is your lover', 'Don't tell you ', '1', '2017-03-01 ', 'Guangzhou', 'http: // www.waterboy.51.cn ', '0', [email protected]', '123 ', [email protected] ', 'Dark Justice', [email protected] ', 'ordinary person', '0'
)

MySQL returns:

#1366-Incorrect string value: '\ xE4 \ xBD \ xA0 \ xE7 \ x9A \ x84...' for column 'question 'at row 1


For varchar data items, an error is returned when saving them in Chinese!

------ Solution --------------------
Set the encoding of the mysql database to UTF-8.

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.