I have a redhat linux server.

I ran yum update mysql and it worked fine. The problem is that when I went to phpMyAdmin all of the databases were deleted. So I used "import" to import the database which I backed up before the process, but in the middle I got an error saying "primary key duplication" (though I could not find it in the file).

phpMyAdmin listed all tables created until that point. When I used SELECT * FROM table_which_caused_error query, I got all rows even though this table wasn't listed in the tables list. However, when I tried to run "DROP TABLE table_which_caused_error" I got an error saying "table does not exist".

What can be wrong??



  • Are the tables/databases present when you use mysqladmin? May 15, 2011 at 13:38
  • @TiZon - No, they are not there as well
    – Joel
    May 15, 2011 at 13:49
  • (but when using SELECT, it does return rows from the table)
    – Joel
    May 15, 2011 at 14:06
  • Restart mysql server and check if the tables exist.
    – Sameer
    May 15, 2011 at 14:31
  • It seems that your data directory is not consistent with the mysql database (system database). Are you using Innodb or MyISAM?
    – ghm1014
    May 17, 2011 at 20:56

2 Answers 2


mysql_upgrade needs to be run after upgrading mysql. In CentOS and the remi version of mysql, it is not added to the rpm post processing as far as i can tell. Of course, you want to see if /etc/init.d/mysqld restart && /etc/init.d/httpd restart helps as well.

man mysql_upgrade:

mysql_upgrade examines all tables in all databases for incompatibilities with the current version of MySQL Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.

mysql_upgrade should be executed each time you upgrade MySQL. It supersedes the older mysql_fix_privilege_tables script, which has been removed in MySQL 5.5.


In phpMyAdmin , in Settings tab, you can try checking the following values:

Settings -> SQL Queries -> Ignore multiple statement errors If you are using CSV format:

Settings -> Import -> CSV -> Do not abort on INSERT error If you are using SQL format:

Settings -> Export -> SQL -> Use ignore inserts

you use my answer here with details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.