How to solve the Chinese problem of MySQL database

Source: Internet
Author: User

How to solve the Chinese problem of MySQL database:

1. my. ini MySQL Configuration File Settings

[Client]

Default-character-set = gbk

[Mysqld]

Default-character-set = gbk

2. Start the MySQL service to create your database

3. Verify the current Encoding

Command Line input:

Mysql-u root-p

Log on to your database

> Connect yourdatabasename

Enter database STATUS Command

> Status

The result is as follows:

Server characterset: gbk

Db characterset: gbk

Client characterset: gbk

Conn. characterset: gbk

The database character set is set correctly.

3. Then (Note: OPTIONAL), add parameters after the JDBC URL

? AutoReconnect = true & useUnicode = true & characterEncoding = GBK

You can skip this step. The current jdbc driver automatically recognizes the character set of the MySQL database.

If you are using utf8 encoding, you can change default-character-set to utf8, and MySQL uses latin1 by default.

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.