Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2152697
  • 博文数量: 157
  • 博客积分: 10047
  • 博客等级: 上将
  • 技术积分: 6757
  • 用 户 组: 普通用户
  • 注册时间: 2005-05-19 11:38
文章分类

全部博文(157)

文章存档

2011年(16)

2010年(50)

2009年(42)

2008年(49)

我的朋友

分类: Mysql/postgreSQL

2010-04-16 16:39:24

默认情况下mysql不会安装一些扩展字符集,如big5等
在将mysql从一个库导入到另一个库时出现异常,Unknown character set: 'big5'
[Err] [Dtf] 1115 - Unknown character set: 'big5'
[Err] [Dtf] Finished - Unsuccessfully
经过分析发现这个库不支持big5
回看安装文档用的--with-charset=all竟然不包括big5
./configure --prefix=/usr/local/mysql --with-charset=all
须使用--with-extra-charsets=all安装一些扩展的字符集
--with-extra-charsets也可以指定字符集
如:--with-extra-charsets=big5,ascii,gb2312,gbk,utf8,latin1
--with-collation=utf8_bin
设定
 ./configure --prefix=/usr/local/mysql
 ./configure --with-charset=utf8 --with-collation=utf8_bin --with-extra-charsets=big5,ascii,gb2312,gbk,utf8,latin1 --prefix=/usr/local/mysql
 ./configure --with-charset=utf8 --with-extra-charsets=all --prefix=/usr/local/mysql
 ./configure --with-extra-charsets=all --prefix=/usr/local/mysql
./configure --prefix=/usr/local/mysql --with-charset=all

做完同步后slave  I/O thread 就会自动退出,并且slave的状态变为  Slave_IO_Running: NO
100416 11:41:40 [ERROR] The slave I/O thread stops because master and slave have different values for the COLLATION_SERVER global variable. The values must be equal for replication to work
100416 11:41:40 [ERROR] Slave I/O thread exiting, read up to log 'mysql-bin.000012', position 124509820
查看collation 的相关设置,发现主和备不一致,这是由于在安装时设置了--with-collation=utf8_bin,从新安装即可
从:
mysql> show variables like "%collation%";
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | utf8_bin          |
| collation_server     | utf8_bin          |
+----------------------+-------------------+
3 rows in set (0.00 sec)
主:
mysql> show variables like "%collation%";
+----------------------+-------------------+
| Variable_name        | Value             |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database   | latin1_swedish_ci |
| collation_server     | latin1_swedish_ci |
+----------------------+-------------------+
3 rows in set (0.00 sec)
mysql>
阅读(1746) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~