mysql和php的乱码问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 05:42:01
错误提示:Illegal mix of collations (gb2312_chinese_ci,IMPLICIT)
and (latin1_swedish_ci,COERCIBLE) for operation '='
如何才能解决这个错误呢,感谢哪位帮我解决这个问题

<!-- connect database begin -->
<sql:setDataSource driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/sh_ly_infosys?useUnicode=true&characterEncoding=utf8"
user="root" password="browser"/>
<!-- connect database end -->
就好了,
插入的也正常了。
没有乱码。
用console select 出来也正常,
上面的连接字符串,我是在书上看来的,
characterEncoding=GB18030就是为了解决中文乱码,
当时针对的版本是4.0版的mysql,
刚才我发现
character_set_system
始终是utf8
用set 提示read only
于是去查文档,发现
10.6. UTF8 for Metadata
Metadata is the data about the data. Anything that describes the database, as opposed to being the contents of the database, is metadata. Thus column names, database names, usernames, version names, and most of the string results from SHOW are metadata.

Representation of metadata must satisfy these requirements:

All metadata must be in the same character set. Ot