Heim >Datenbank >MySQL-Tutorial >mysql点滴_02程序中执行sql语句报字符集问题解决_MySQL

mysql点滴_02程序中执行sql语句报字符集问题解决_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:04:041034Durchsuche

程序中执行 "SELECT t.EVENT_TYPE_ID FROM RATABLE_EVENT_TYPE t WHERE t.NAME='帐期末费用转移事件'" 报错
错误码:1267 不合法的混合字符集。
错误信息:mix of collations (gbk_bin,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
解决办法:用binary()函数统一字符集 SELECT t.EVENT_TYPE_ID FROM RATABLE_EVENT_TYPE t WHERE t.NAME=binary('帐期末费用转移事件')

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn