mysql裝置後添加gbk字符集的辦法。本站提示廣大學習愛好者:(mysql裝置後添加gbk字符集的辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是mysql裝置後添加gbk字符集的辦法正文
1、檢查以後字符集:
SHOW CHARACTER SET;
2、刪除mysql相干目次
rm -rf /usr/local/mysql/* 裝置目次
rm -rf /var/lib/mysql/mysql 數據庫目次
3、從新編譯
./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=complex
make clean
make
make install
4、裝置後任務:
停滯mysql辦事。
Pkill -9 mysql
cd /var/lib/mysql/
先把master.info和relay有關的日記全體刪失落
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 '123456' 登錄mysql嘗嘗:
/usr/local/mysql/bin/mysql -u root -p