gpt4 book ai didi

mysql replication incompatible statements问题

转载 作者:行者123 更新时间:2023-11-30 23:51:56 30 4
gpt4 key购买 nike

我想设置一个新的 mysql 数据库从属数据库,运行比主数据库 => 5.0.75 更新版本的 mysql => 5.1.41,据我所知,这通常应该没有问题。然而,事实证明设置复制失败了,因为我在 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
...
...

有什么想法、发生了什么以及该做什么吗?

谢谢!

更新

好吧,我自己通过在 slave 上编译 5.0.75 解决了这个问题......但是,我仍然很感兴趣,这是怎么回事以及如何处理这些问题。谢谢。

最佳答案

对于像这样(不重要)的错误,您可以在 my.ini 文件中过滤掉。

# skip replication errors
slave-skip-errors=1062,1136,1146

或者修改有问题的代码,使其版本友好。

关于mysql replication incompatible statements问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3476731/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com