PhpMyAdmin: MySQL Error 1062 - Duplicate Records

I connect with the root user to my test database, which I host locally for development. Among other things, I have a "rating" table. For some reason, when I click on the table "ratingcomment", phpMyAdmin shows me the following error:

Fehler

    SQL-Befehl: 

    INSERT INTO  `phpmyadmin`.`pma_history` (

    `username` ,
     `db` ,
     `table` ,
     `timevalue` ,
     `sqlquery`
    )
    VALUES (
    'root',  'test',  'ratingcomment', NOW( ) ,  'SELECT * FROM `ratingcomment`'
    )
    MySQL meldet: 

    #1062 - Duplicate entry '838' for key 'PRIMARY'

I used google to search for the following

"This indicates that you have a UNIQUE or PRIMARY index on a table, and there is a duplicate value someone on one of the values in one of these indexes."

But I still do not quite understand the mistake! I use a primary key, which is automatically incremented for all my tables, so there really shouldn't be a problem with the table. I had another table with the name "rating" in which there was a column of "comment". Maybe this is causing problems?

+3
3

:

REPAIR TABLE `phpmyadmin`.`pma_history`

, / .

TRUNCATE TABLE `phpmyadmin`.`pma_history`

phpmyadmin , db.

MyISAM . , , : MySQL , FULLTEXT, - .

, REPAIR ( , ) . : MyISAM, , usable. . doc.

Google, pma-, this.

+7

. :

SELECT * FROM `ratingcomment`

phpMyAdmin , . Google pma_history, .

, SQL- (, HeidiSQL) phpMyAdmin.

0

I know this is a little late, but I had the same problem and I wanted to share what I did.

In PhpMyAdmin, I went to the "Table Operation" tab and simply increased the AUTO_INCREMENT value in the "Table Settings" section and inserted a dummy entry.

0
source

Source: https://habr.com/ru/post/1778145/


All Articles