MySQL Error1366:incrrect String Value ...

Source: Internet
Author: User

I remember that when I installed MySQL with UTF8 as the default character encoding, and then always use the time to insert the data is also in English, so has not encountered this error.

Insert Chinese today then the error 1366 will pop up, the data cannot be inserted. On the Internet to check some information, I feel a lot of users to the solution has not worked, I hope this write

Something that can help you:

First of all, if you do not notice the problem of character encoding when installing MySQL, then the system default character encoding is Latin1, and this encoding is not supported in Chinese, so

It's understandable to have a problem. So what we're going to do is change the default character encoding:

First, through the MySQL Configuration Wizard:

Keep the other options intact until the following:

Choose manual Selected Default charater set/collation, inside choose UTF8;

After the changes are re-inserted, you will find that the error 1366 is still inserted, and then modify one of the My.ini files in the MySQL installation directory.

Open the file, modify the Default-character-set in the diagram to GBK,

Then look at the character-set-server in the mysqld tag in the back to keep it utf8 unchanged,

Well, save it!!! You will then find that you cannot save or save any error messages such as failures. The Netizen proposed to stop the MySQL service to be OK, after tried

Totally useless. We might as well cut the My.ini from the current path and put it in any other directory, and you'll find that you need administrator privileges to move, um,

Yes, it's a privilege issue. OK, save it and then re-put it back to the original location. Then reinsert the Chinese and it's working.

MySQL Error1366:incrrect String Value ...

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.