Configure the default character set (character-set) of MySQL in Linux)

Source: Internet
Author: User
The following Linux runs Ubuntu7.10MySQL as 6.0a. The default Character Set installed in MySQL is liant1. To use uft8, you must set it every time.

The following Linux runs Ubuntu 7.10 MySQL as 6.0a. The default Character Set installed in MySQL is liant1. To use uft8, you must set it every time.

The following Linux runs Ubuntu 7.10 MySQL as 6.0a.

The default Character Set installed in MySQL is liant1. To use uft8, you must set it every time. For convenience, you can change the default character set to uft8.

The method is as follows:
1. Find and edit the file my. cnf, which is located under/etc.
Sudo gedit/etc/my. cnf
2. Locate the [MySQLd] section ,,
Modify or add the following lines:
Default_character_set = utf8
3. Find the [MySQL] section,
Modify or add the following lines:
Default_character_set = utf8
4. Restart the MySQL service.
Disable the service first:
MySQLadmin-uroot-p password shutdown

Restart the service:
Sudo/usr/local/MySQL/bin/MySQLd_safe -- user = MySQL &
Above:
/Usr/local/MySQL/bin/is the folder where MySQLd_safe is located. installation location
-- User = MySQL is written to MySQL users for startup.

Go to MySQL
Run: show variables like 'character %'
Let's see the result!

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.