以前的步骤装完MySQL后,进行配置时选MySQLServerInstanceConfigWizard->detailoption当时选的编码为gb2312,不 道为什么到哪都出乱码。
这次换了个步骤:
1.装MySQL5.1,没有进行MySQLServerInstanceConfigWizard配置,选用standoption选项进行配置。进入MySQL后显示中文乱码,插入中文乱码setnamesgb2312后解决。
2.装MySQLODBC5.1。
3.装MySQLfront进行连接字符集选gb2312colaction选gb2312_chinese_ci。
在创建表,表字段时选用gb2312进行编码。
<%
setconn=server.createobject("adodb.connection")
connectionstring="driver={mysql;server=localhost;uid=root;password=abc;opt=3;smt=SETNAMES'gb2312'"
conn.openconnectionstring
setrs=server.createobject("adodb.recordset")
rs.open"selectfromtestme",conn,1,1
whilenotrs.eof
response.writers("username")
rs.movenext
wend
rs.close
setrs=nothing
sql="insertintotestme(username)values('中国')"
conn.executesql
%>
这样就不会出现乱码了。