You have ansyntax error beforein your SQL syntax; MYsql 预定事件 创建问题 !

& Categories &
& ERROR 1064: You have an error in your SQL syntax解决方案
今天看见有个同学说使用帝国备份王的时候不能备份提示1.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql -u root -p 123456' at line 1 mysql -u root -p .You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 select * from `CHARACTER_SETS` limit 0。
产生原因:因为使用了高版本的SQL语句在低版本中导入,主要是可能用MYSQL4.1版本中的语句在MYSQL4.02中运行不同版本之间导入.
解决方面:升级MYSQL数据库到相应的对应版本或者:
ENGINE=MyISAM DEFAULT CHARSET=latin1
或者程序代码
ENGINE=InnoDB DEFAULT CHARSET=latin1
全部替换为程序代码
ENGINE=MyISAM
可以将SQL文件分批COPY建立SQL文件,然后 分批导入.
这样方便查找具体是那个地方出错,如:
ERROR 1074 at line 1802: Too big column length for column 'Cjieshao' (max = 255. Use BLOB instead
说明文件字符长度超过当前版本. MYSQL4.0只支持255个,当高版本如MYSQL5.0导入时候就要注意
修改长度为255再导入就会正常
ERROR 1064 at line 3034: You have an error in your SQL syntax.
Check the manua that corresponds to your MySQL server version for the right syntax to use near
'collate utf8_swedish_ci default NULL, PRIMARY KEY
(`sshyid`)
解决方法: 去掉 'collate utf8_swedish_ci 就正常
.sql -u root -p密码
相关文章推荐
暂无相关文章MySql JDBC:You have an error in your SQL - CSDN博客
用Statement来创建sql语句写多了,然后由于安全,性能等等的因素改用PreparedStatement来创建sql语句,但是呢,原来拷贝过来的
st.executeQuery(sql);还是用的原来的,这样就造成了,改了前面,忘记了后面的部分没有全部矫正过
PreparedStatement ps =
ps = conn.prepareStatement(sql);
/* 中间省略一万字 */
ps.executeUpdate(sql);
然后在跑这条sql语句的时候,就会报
Exception in thread &main& com.infy.jdbc.dao.DaoException: You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near '?,birthday = ?, money = ? where id
= ?' at line 1
at com.infy.jdbc.dao.impl.UserDaoImpl.updateUser(UserDaoImpl.java:118)
at com.infy.jdbc.dao.UserDAOTest.main(UserDAOTest.java:24)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near '?,birthday = ?, money = ? where
id = ?' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1402)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1317)
at com.infy.jdbc.dao.impl.UserDaoImpl.updateUser(UserDaoImpl.java:116)
... 1 more
因为ps.executeUpdate(sql);是跑不通的,我们可以去查一下jdk的api文档,里面就根本没有executeUpdate(sql);方法,有的是executeUpdate(),所以解决的办法就是去掉参数sql就可以了。当前位置: &
求翻译:#1064 - You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_fetch_row(select * from liuyan)' at line 1是什么意思?
#1064 - You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_fetch_row(select * from liuyan)' at line 1
问题补充:
#1064 - 您有一个在您的SQL语法错误,请检查您的MySQL服务器版本对应的手册,正确的语法附近使用“mysql_fetch_row(SELECT *从刘燕)”第1行
#1064-您有一个在您的SQL语法错误;检查该手册,符合你的MySQL服务器版本的语法正确使用近“mysql_fetch_row(select*from浏阳)'在1线
#1064 -您有一个错误在您的SQL句法; 检查对应于您的MySQL服务器版本为正确的句法于用途近‘mysql_fetch_row的指南(选择*从liuyan)’在线1
# 1064年-你有一个错误的 SQL 语法 ;请查看对应于您的 MySQL 服务器版本使用附近的正确语法手册 ' mysql_fetch_row (选择 * 从柳燕)' 在第 1 行
# 1064年-你有一个错误的 SQL 语法 ;请查看对应于您的 MySQL 服务器版本使用附近的正确语法手册 ' mysql_fetch_row (选择 * 从柳燕)' 在第 1 行
我来回答:
参考资料:
* 验证码:
登录后回答可以获得积分奖励,并可以查看和管理所有的回答。 |
我要翻译和提问
请输入您需要翻译的文本!当前位置: &
求翻译:MySQL Error : You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM DEFAULT CHARSET=gbk' at line 1是什么意思?
MySQL Error : You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM DEFAULT CHARSET=gbk' at line 1
问题补充:
MySQL 错误: 你有一个错误的 SQL 语法 ;请查看对应于您的 MySQL 服务器版本使用附近的正确语法手册 ' 类型 = MyISAM 默认字符集 = gbk' 在 1 号线
MySQL错误:你有一个错误,您的SQL语法;检查该手册,符合你的MySQL服务器版本的权利的语法,请在“键入=为了找出当前默认charset=GBK”在第1行
我来回答:
参考资料:
* 验证码:
登录后回答可以获得积分奖励,并可以查看和管理所有的回答。 |
我要翻译和提问
请输入您需要翻译的文本!

我要回帖

更多关于 expr syntax error 的文章

 

随机推荐