Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开发环境直连数据库,生产环境直连 cobar ,出现问题了 #84

Open
suhuaguo opened this issue Feb 8, 2018 · 6 comments

Comments

@suhuaguo
Copy link

suhuaguo commented Feb 8, 2018

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; Error occurs around this fragment: { UPDATE heart_bea}. Error cause: SQL syntax error!

在开发环境测试过了,没有问题呢,

@copyshop
Copy link

copyshop commented Feb 9, 2018

可能与数据库版本或者是驱动程序有关,降低驱动程序的版本和数据库版本尝试以下。

@suhuaguo
Copy link
Author

suhuaguo commented Feb 9, 2018

我这边用的是 mybatis 最新的框架,驱动也是最新的。但在 cobar 的端查看日志,最终解析的是正常的SQL 。拿这个解析后的SQL 。在 cobar 端执行,也是没有问题的。
解析出来的SQL:
UPDATE XXX SET update_time = unix_timestamp() WHERE ip = ? ;UPDATE XXX SET update_time = unix_timestamp() WHERE ip = ? ;

很纳闷

@hexianmao
Copy link
Member

方便的话在cobar服务端,调整cobar log为debug级别,观察一下有哪些sql执行,再确认一下这些sql是哪里发出的,可能是mybatis框架,也可能是mysql driver。先定为问题

@suhuaguo
Copy link
Author

suhuaguo commented Feb 9, 2018

就是上面贴的 sql 。

@hexianmao
Copy link
Member

没有其他sql执行了吗?

@suhuaguo
Copy link
Author

suhuaguo commented Feb 9, 2018

是的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants