› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
CR7sun
V2EX  ›  MySQL

关于 discuz 论坛的 mysql 数据插入问题

  •  
  •   CR7sun · Jul 8, 2020 · 2763 views
    This topic created in 2272 days ago, the information mentioned may be changed or developed.

    我现在打开这个基于 discuz 的网站页面有概率出现报错页面,报错显示(1062) Duplicate entry '1940' for key 'PRIMARY',报错详情是:REPLACE INTO common_block_item(itemid, bid, itemtype, id, idtype, title, url, pic, picflag, makethumb, thumbpath, summary, showstyle, related, fields, displayorder, startdate, enddate) VALUES ('', '53', '', '838', 'aid', 'xxx', 'portal.php?mod=view&aid=838', 'static/image/common/nophoto.gif', '0', '0', '', 'xxx', '', '', 'a:12:{s:3:"uid";s:1:"2";s:8:"username";s:4:XXXXX),但我的主键已经设置为自增长,这才 1940 也不可能到上限,请问这个该怎么处理呢?

    2 replies  •  2020-07-08 15:00:17 +08:00
    hbolive
        1
    hbolive  
       Jul 8, 2020
    你先查一下,是不是已经存在 1940 这条数据记录?
    WaldenHorizon
        2
    WaldenHorizon  
       Jul 8, 2020
    你的 db 是单机还是主从,replace into 好像在主从架构上有 bug
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2618 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 11:58 · PVG 19:58 · LAX 04:58 · JFK 07:58
    ♥ Do have faith in what you're doing.