2013-03-20 47 views
1

当我插入一个项目ZABBIX,其中包含中国,将在最后投入的MySQL,浏览器显示:ZABBIX插入中国字作为项目关键失败

Error cannot update item 
Error in query [SELECT i.key_,h.host FROM items i,hosts h WHERE i.hostid=h.hostid AND ((i.hostid=10085 AND i.key_='logrt[\"/home/test/event.*.log\",\"失败\",\"GBK\",,]')) AND i.itemid!='23439' LIMIT 1 OFFSET 0] [Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='] 
mysql_fetch_assoc() expects parameter 1 to be resource, boolean given 
[include/db.inc.php:572] mysql_free_result() expects parameter 1 to be resource, boolean given 

[include/db.inc.php:573] 

我认为失败是因为ZABBIX不能接受除UTF-8以外的其他编码,但我不知道如何更改它。谢谢

+0

你最好检查一下latin1从哪里来的模式? – 2013-03-20 17:30:31

回答

0

好的,我找到了问题。看来,当我创建zabbix数据库时,我使用了默认字符集,即latin1_swedish_ci,但实际上它是utf8。所以,我重新数据库SQL语句:

create database zabbix character set utf8 

然后一切工作正常!