MYSQL Modify Character Set

Source: Internet
Author: User

1. Add Default-character-set=utf8 to the [client] field as follows:

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8

2. Add Character-set-server=utf8 to the [mysqld] field as follows:

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
character-set-server=utf8

3. Add Default-character-set=utf8 to the [MySQL] field as follows:

[mysql]
no-auto-rehash
default-character-set=utf8

net start MySQL;
Mysql-hlocalhost-uroot-p Enter the MySQL database, where-H is the server name, localhost means local;-U is the database user name, root is the MySQL default username;-P is the password, if the password is set, Can be directly after-p link input, such as:-p123456, the user does not set the password, display enter password, directly enter. Note that if your MySQL is not installed in the C drive, you will need to use the DOS command to go to the bin directory in the MySQL installation directory. Take My computer as an example, the method is as follows: Enter D: Enter the D-drive, enter the bin directory of the MySQL in the input CD D:\Tools\MySQL5.5.25\bin to enter the Mysql-hlocalhost-uroot-p

SHOW VARIABLES like ' character% ';

MYSQL Modify Character Set

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.