mysql复制不兼容语句问题
我想设置一个新的 mysql 数据库从属运行较新版本的 mysql => 5.1.41比大师=> 5.0.75,据我所知,通常应该没有问题。然而,事实证明设置复制失败,因为我在 5.0.75 中使用了一条 SQL 语句,该语句显然在 5.1.41 中不再工作:
导致问题的语句如下所示:
DELETE FROM tab1 t1
USING tab1 t1, tab2 t2
WHERE t2.field1 = ...
AND t2.field2 = ...
AND t1.field1 = t2.field2;
此语句在 5.0.75 上完美运行,在 5.1.41 上,我在我的从属状态中收到以下错误消息:
...
Last_SQL_Errno: 1064
Last_SQL_Error: Error '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 't1
USING tab1 t1, tab2 t2
...
...
有什么想法,发生了什么以及该怎么办?
谢谢!
更新
好吧,我通过自己在从属设备上编译 5.0.75 解决了这个问题...但是,我仍然感兴趣,发生了什么以及如何处理此类问题。谢谢。
i wanted to setup a new mysql database slave running a newer version of mysql => 5.1.41 than the master => 5.0.75, which -- as far as i know -- should normally be no problem. however, as it turns out setting up replication fails, because i used a SQL statement in 5.0.75 which apparently does not work in 5.1.41 anylonger:
the statement which causes the trouble looks like:
DELETE FROM tab1 t1
USING tab1 t1, tab2 t2
WHERE t2.field1 = ...
AND t2.field2 = ...
AND t1.field1 = t2.field2;
this statements runs perfectly on 5.0.75, on 5.1.41 i get the following error message in my slave status:
...
Last_SQL_Errno: 1064
Last_SQL_Error: Error '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 't1
USING tab1 t1, tab2 t2
...
...
any ideas, what's going on and what to do?
thanks!
UPDATE
ok, i solved this problem by compiling 5.0.75 on the slave myself ... however, i would still be interested, what's going on and how to deal with such problems. thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这样的错误(这并不重要),您可以在 my.ini 文件中过滤掉。
或者修改有问题的代码,使其版本友好。
For errors like this (that aren't important) you can filter out in the my.ini file.
Or alternatively modify the offending code so that it is version friendly.