Unable to insert Chinese when using MySQL.

Source: Internet
Author: User

Use the tools, MySql5.0 and graphical tools Navacat.
1. Change the configuration in the My.ini in the MySQL system file first as soon as you install it.
 
   
  
  1. [mysql]
  2. default-character-set=gbk #默认是latin1,把他改成了gbk。

2. The table is then created, but when the Chinese value is inserted, "Data too long for column ' Realname ' at row 1" is displayed. No matter how long the varchar is changed. after the Internet to find the answer, because I use the graphics, most of the Internet is the command line, so ultimately no fruit.
3. Later Daoteng himself Navacat. A. First, the MySQL configuration file My.ini is opened. [Mysqld] was found.


B. change the configuration below.
  
 
  1. # The default character set that will be used when a new schema or table is
  2. # created and no character set is defined
  3. default-character-set=utf8 #默认是latin1, changed him into a utf8.

c. Open the database table with Navacat, right-click Table, select Design Table

d. Select the column you want to modify, and then there is a "character set" option below. (Haha, now clear), change the character set on it!!

4. Then I inserted in the Chinese will be no problem!!









From for notes (Wiz)

Unable to insert Chinese when using MySQL.

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.