dtp19819 2014-01-15 11:34
浏览 27
已采纳

MySQL行消失(神秘)

I have 3 tables A, B and C which are directly linked and should contain the same number of rows, the rows for each table being created together.

I've recently noticed that after creating 1000 rows for test purposes (rows are definitely inserted, no transactions, system stable), and without any application activity, there seem to be rows missing. A random amount of rows (0-50) from each table (e.g -30, -24, -7 which vary) seem to be missing after several hours of inactivity.

This has happened several times, and at first I didn't notice, but now I am positive. There is no code with anything such as DELETE FROM table(A/B/C), so I have my doubts about a coding bug doing this.

I am using phpMyAdmin when I notice the missing rows, and a direct CLI query confirms this. I am certain I am not accidentally deleting the rows through the GUI. Also, this is on a local test environment, so no (hopefully) public access.

Is there something in MySQL (a limitation setting) that could be causing this? These are not unusual tables or rows, 10 columns each, CHAR/INT/ETC. types, 250kb each total each table.

Would a binary log file show which rows are being deleted and when and by whom? Any special considerations for configuring the logging?

  • Language is PHP, MySQL is InnoDB, WAMP, Windows, viewed through phpMyAdmin
  • 写回答

2条回答 默认 最新

  • dozabg1616 2014-01-15 11:38
    关注

    You are using phpMyAdmin.

    The preview of a table gives a estimated row count, not the actual one if you have alot of rows in your table.

    Try

    SELECT COUNT(*) FROM tableA;
    SELECT COUNT(*) FROM tableB;
    SELECT COUNT(*) FROM tableC;
    

    and see if there is really a different row count.

    Otherwise, do you have any triggers set? Or any integrity issue with innoDB?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看