asp.net mysql无法查询中文;You have an error in your SQL syntax; check the manual that corresponds to
来源:互联网 发布:用软件装系统 编辑:程序博客网 时间:2024/05/20 21:44
初涉Asp.net,用VS2008连接MySql,
在用到查询语句时出现上述错误,经过一步步探究发现是查询语句字符编码不一致问题。但我不知道两个程序怎样设置字符编码。
看到一篇回复:
mysql> show variables like '%set%';
+--------------------------+----------------------------------------------------
-----+
| Variable_name | Value
|
+--------------------------+----------------------------------------------------
-----+
| auto_increment_offset | 1
|
| character_set_client | utf8
|
| character_set_connection | utf8
|
| character_set_database | utf8
|
| character_set_filesystem | binary
|
| character_set_results | utf8
|
| character_set_server | utf8
|
| character_set_system | utf8
|
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.0\share\chars
ets\ |
+--------------------------+----------------------------------------------------
-----+
9 rows in set (0.00 sec)
对比一下发现我的 character_set_server=latin1
于是在My.ini中加入一行
character_set_server=utf8
再重启mysql就可以正常查询了
- asp.net mysql无法查询中文;You have an error in your SQL syntax; check the manual that corresponds to
- ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL的问题
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- 错误信息:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
- DbVisualizer报错You have an error in your SQL syntax; check the manual that corresponds to your MySQL
- Android开发————Intent中的四个重要属性Action、Data、Category、Extras
- 一些要记住的话
- ios-使用NSXMLParser解析XML文件
- web前端优化工具
- 【欧拉函数】 HDOJ 4483 Lattice triangle
- asp.net mysql无法查询中文;You have an error in your SQL syntax; check the manual that corresponds to
- 相对布局 梅花布局效果
- CoreData版本迁移
- 正确理解线程和进程
- 动态规划 之 最长公共子序列(非连续)
- 17 activity详解002 关闭提示是否退出
- Python框架——Tornado
- STL算法目录
- ubuntu 64 位安装becompare