How to add the gbk character set after installing mysql

Source: Internet
Author: User

1. view the current character set:

Copy codeThe Code is as follows: show character set;

2. Delete mysql related directories

Copy codeThe Code is as follows: rm-rf/usr/local/mysql/* installation directory
Rm-rf/var/lib/mysql database directory

3. recompile

Copy codeThe Code is as follows :. /configure -- prefix =/usr/local/mysql -- sysconfdir =/etc -- localstatedir =/var/lib/mysql -- with-charset = gbk -- with-collation = gbk_chinese_ci --- extra-charsets = complex
Make clean
Make
Make install

4. Post-installation:
Stop the mysql service.

Copy codeThe Code is as follows: Pkill-9 mysql
Cd/var/lib/mysql/

Delete all logs related to master.info and relay.

Copy codeThe Code is as follows: rm-rf *. bin
Rm-rf mysql-bin .*
/Usr/local/mysql/bin/mysql_install_db
Chown-R mysql/var/lib/mysql
Cp/usr/local/src/mysql-5.1.55/support-files/my-medium.cnf/etc/my. cnf
/Usr/local/mysql/bin/mysqld_safe &
/Usr/local/mysql/bin/mysqladmin-u root-p password '000000' try to log on to mysql:
/Usr/local/mysql/bin/mysql-u root-p
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.