MySQL database input data garbled problem

Source: Internet
Author: User
1. First check whether the value passed in from the front-end interface is garbled 2. View the character set in the MySQL database 2.1 cmd into the MySQL installation directory: D:\Program files\mysql\mysql Server 5.5\bin2.2 into the database: MySQL -U root-proot2.3 View database encoding format: Show variables like '%character% '; 2.4 The following interface appears:

3.: If the encoding format is not UTF8 or is different from the page character format. Locate the My.ini configuration file in the database installation directory. Change configuration parameters to: [Mysql]default-character-set=utf8 (Modify encoding format) [mysqld]character-set-server= UTF8 (Modify encoding format) 4. Restart the database 5. Note: 1. You can also set the encoding format in cmd: set names GBK; however, the encoding format will be changed back to the previous encoding format, that is, the encoding format of the configuration file, after the cmd restart. 2. The encoding format of the foreground must be the same as the encoding format of the database. Reference excerpt: http://www.blogjava.net/wldandan/archive/2007/09/04/142669.htmlhttp://www.cnblogs.com/sunzn/archive/2013/ 03/14/2960248.htmlhttp://www.cnblogs.com/sunzn/archive/2013/03/14/2960248.html

MySQL database input data garbled problem

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.