MySQL add Chinese, Data too long for column error

Source: Internet
Author: User
Tags mysql client

At first, I thought it was my own character length problem, and after shortening it was still a problem. The original is because the Chinese code.

Workaround: Modify the DEFAULT_CHARACTER_SET=GBK in the My.ini file;

# CLIENT section#----------------------------------------------------------------------# # The following options would be read by MySQL client applications.# Note This only client applications shipped by MyS QL is guaranteed# to read ThisSection . If you want your own MySQL client program to# Honor these values, you need to specify it as an option during the# MySQL CL Ient Library Initialization.#[client]port=3306[MySQL]default-character-set=gbk# SERVER section#----------------------------------------------------------------------# # The following options would be read by the MySQL Server. Make sure that# you had installed the server correctly (see above) so it reads This# file.#[mysqld]# The TCP/IP Port The MySQL Server would listen Onport=3306#Path to installation directory. All paths is usually resolved relative to This. Basedir= "C:/Program files/mysql/mysql Server 5.0/"#Path to the database Rootdatadir= "C:/Program files/mysql/mysql Server 5.0/data/"# thedefaultCharacter set that would be used when aNewschema or table is# created and no character set is defineddefault-character-set=utf8

MySQL add Chinese, Data too long for column error

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.