سؤال

When I insert a item to zabbix, which contains chinese and will be put into mysql at last, the browser shows:

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]

I think it fails because zabbix can not accept other encoding except UTF-8, but I don't know how to change it. Thanks

هل كانت مفيدة؟

المحلول

OK, I find the problem. It seems that when I created the zabbix database I used the default character set, which was latin1_swedish_ci but actually it shoule be utf8. So I recreate database with following sql:

create database zabbix character set utf8

Then everything works fine!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top