phpMyAdmin: MySQL Error 1062 - Duplicate entry

不问归期 提交于 2019-12-05 22:22:21

Quick fix:

REPAIR TABLE `phpmyadmin`.`pma_history`

If that fails, I'd just truncate/empty the table.

TRUNCATE TABLE `phpmyadmin`.`pma_history`

Although phpmyadmin has it's place in my toolbox, I personally don't use it's internal db.

ADDENDUM

MyISAM tables can easily become corrupted. A couple causes that usually hit me: if the MySQL is not shutdown properly, or if the table has a FULLTEXT index and the stopword file on disk had changed.

Simply stated, the REPAIR just checkes the data file for errors (and depending on your options, makes it usable again) and rewrites the index file. Fair warning: with MyISAM, repairing a table can often toast all your data in that table to make it usable. See doc for more details.

A google search pertaining to this pma table being corrupted lead me to this.

This appears to be an internal error. You've issued this query:

SELECT * FROM `ratingcomment`

phpMyAdmin tries to write such action in its internal event log and it fails. If you Google for pma_history you'll find several references to such table being corrupted.

My advice is that you find another SQL client (such as HeidiSQL) and try to repair the phpMyAdmin database.

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

In PhpMyAdmin, I went to the table's Operation tab, and just incremented the AUTO_INCREMENT value under Table options and inserted a dummy record.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!