又是一场大雪过后,天空像海一样蔚蓝,甚至比海更加晶莹剔透。千峰万岭,极目望去,尽是白色,闪耀着一片连接不断的银光。山顶积雪未融,如白银宫网。
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
到此这篇关于mysql安装后添加gbk字符集的方法就介绍到这了。永不放弃是你梦想实现的唯一秘诀。更多相关mysql安装后添加gbk字符集的方法内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!