[Original] how to set the default character set encoding of MySQL database to GBK

Source: Internet
Author: User
I have been engaged in the discuz Forum recently, using MySQL + PHP

Because the default character set encoding of MySQL is Latin, we generally use GBK or gb2312 encoding.
So it is easy to cause garbled characters if it is not changed.

I am using MySQL 5.0 for installation.ProgramInstallation Directory: C: \ Program Files \ mysql \ MySQL Server 5.0
Go to this directory and find my. INI File

Modify default-character-set = Latin1 to default-character-set = GBK

Remember, there are two things to change.

The most important thing is to stop the MySQL service before modifying the file, and restart it after modification.
Use the doscommand: net stop MySQL to stop the service. Net start MySQL to start

Then, execute your MySQL script. Everything is OK! Here you can use discuz SQL as an example to run it!

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.