我的程序非常簡單,它在一列中插入相同的值,並更新另一列中的時間戳和日期。它還有一個自動遞增的ID列,充當表的主鍵。在主鍵mysql上的重複條目
+-------+------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+-------------------+-----------------------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| Power | float | YES | | NULL | |
| dt | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+-------+------------+------+-----+-------------------+-----------------------------+
在我,當我試圖運行數據插入到表中的命令套牢id = 4000
Power = 40996
和dt = recent date time
的那一刻,我明白,指出
錯誤鑰匙「主」的重複條目'4971'
檢查表:
+----------------+-------+----------+-----------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+----------------+-------+----------+-----------------------------------------------------------+
| newdb.newmeter | check | warning | Table is marked as crashed |
| newdb.newmeter | check | warning | 19 clients are using or haven't closed the table properly |
| newdb.newmeter | check | warning | Size of datafile is: 68816 Should be: 68663 |
| newdb.newmeter | check | error | Found 4048 keys of 4039 |
| newdb.newmeter | check | error | Corrupt |
+----------------+-------+----------+-----------------------------------------------------------+
什麼是插入查詢? – piotrm 2011-04-27 02:14:09
insert into newdb.newmeter(Power)values(40997); – rasmalai 2011-04-27 02:27:10
@piotrm插入newdb.newmeter(Power)值(40997); – rasmalai 2011-04-27 02:30:54