MySQL changes the default environment of the character set to Utf-8

Source: Internet
Author: User

MySQL Change environment default character set is Utf-8 (of course you can also set to other, international point or utf-8 Good)

assume that the MySQL character set is not unified. There's still a bit of trouble back there.

first you have to turn off the MySQL service in the service (be sure to turn off the MySQL service and change it first)

then go to your MySQL installation path. Assuming that you define your own path, the default is:C:\Program files\mysql\mysql Server 5.0\my.ini. (There is not this, the lower version is Mysql-default.ini)



find that [client] [MySQL] add : default-character-set=utf8

Mysqld added below: Default-character-set=utf8

init_connect= ' SET NAMES UTF8 '



start MySQL service again after saving


then use the following statement to see if the encoding has changed:


Show variables like ' char% ';



It 's good to say that.


Suppose that your previous database was not set up well:

For a database that already exists, you can change the encoding by doing the following:
A. Change the MySQL database encoding.  The assumption is that the MySQL database is not encoded: the ability to run in MySQL such as the following command: ALTER database test DEFAULT CHARACTER SET UTF8;

MySQL changes the default environment of the character set to Utf-8

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.