Linux under MySQL environment support Chinese configuration steps

Source: Internet
Author: User

before the SQL script executes, add:CREATE DATABASE IF not EXISTS mydatabase DEFAULT CHARSET UTF8 COLLATE utf8_general_ci;Use broadleaf; Replace the table code in the original backup:Engine=myisam DEFAULT charset=latin1globally replaced by:Engine=innodb DEFAULT Charset=utf8This is just to support MySQL database and table to Chinese  recommended for MySQL global support to Chinese (Linux environment)

1:root login to server

2: Login to MySQL

mysql-u User name -P, enter the password

3: Check the current encoding

Show variables like '%char% '; The default is latinl.

4: Modify the mysql configuration file , the normal installation of the file in etc/my.cnf, Modify this file

VI etc/my.cnf, add the following configuration, save Exit

[Client]

Default-character-set=utf8

[Mysqld_safe]

Default-character-set=utf8

[Mysqld]

Default-character-set=utf8

#default-table-type=innodb

[MySQL]

Default-character-set=utf8

5: restart mysql

/etc/rc.d/init.d/mysqld stop

/etc/rc.d/init.d/mysqld start


6: Check the current encoding again

Show variables like '%char% ';

The MySQL environment in Linux supports Chinese configuration steps

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.