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