Revise the charset of MySQL to Uff-8

Source: Internet
Author: User
Tags file permissions

MacOS 10.6.8 Snow Leopard
MySQL 5.5.13

MySQL default installation (installed in the/usr/local/mysql directory)

See some of the character sets used for latin1 by show variables like ' character% ' command

In MacOS need to actively create a new configuration file, and make changes, most of the online modification of the sample after the execution of MySQL is no way to start, and then finally found a useful, record down memo

1. > sudo cp/usr/local/mysql/suportfiles/my-small.cnf/etc/my.cnf
Description
/ETC/MY.CNF If this file exists, it will be loaded as the MySQL default configuration file
However, the file permissions are special, no Super administrator can not operate, modify the file permissions for 777 after the MySQL service failed to start, so on the safe side, do not modify the file permissions, directly with the Super administrator operation is OK

2. > sudo vi/etc/my.cnf
Description
Use VI command to modify, but if not super admin also play not to turn

3. Under [client], add
Default-character-set = UTF8
Description
Online also use Default_character_set = UTF8 command, did not try, do not know this good to make
Note that there are spaces around the equals sign

4. Under [Mysqld], add
Default-storage-engine = INNODB
Character-set-server = UTF8
Collation-server = Utf8_general_ci
Description
Before the bad food is bad here, press before the online recommended in [mysqld] as long as add Default_character_set=utf8,mysql service will not come, depressed, according to the above configuration no problem

5. File save exit, restart MySQL service

6. Re-login MySQL use the command to view the character set, all changed to UTF8 is OK

Reference:

http://lj6684.iteye.com/blog/1204427

Revise the charset of MySQL to Uff-8

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.