【问题标题】:ProxySQL insert get duplicate entry on PHP 7.4.23 (Silverstripe)ProxySQL 在 PHP 7.4.23 (Silverstripe) 上插入重复条目
【发布时间】:2021-10-28 14:09:10
【问题描述】:

请帮忙

我目前正在使用 1 个主设备和 2 个从设备来设置 ProxySQL。我已经像这样设置了 mysql_query_rules here the image 但我在 mysql 客户端上按预期工作,插入到主服务器,选择到从服务器。但是当我将我的 PHP 项目连接到 ProxySQL 时,插入任何内容时出现错误。

Error insert

我的操作系统:Centos 7 PHP:7.4.23(银条 3) 也许有人遇到过这样的麻烦,并且已经解决了。

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: proxysql


【解决方案1】:

终于解决了,这个错误的发生是因为 silverstripe 上的错误,当插入时实际上先插入以获取 ID,然后更新它以填充该字段。 but when try to update it check the ID first this make the problem because when insert proxysql goes to master, but when select for check ID goes to slave that not yet update by the insert from master because delay. 所以我使用match_digest查询检查ID并安排到主主机组。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-12
    • 2012-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-01
    • 1970-01-01
    • 2021-02-13
    相关资源
    最近更新 更多