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??

Thanks,

Joel

link|improve this question

33% accept rate
Are the tables/databases present when you use mysqladmin? – Bart De Vos May 15 '11 at 13:38
@TiZon - No, they are not there as well – Joel May 15 '11 at 13:49
(but when using SELECT, it does return rows from the table) – Joel May 15 '11 at 14:06
Restart mysql server and check if the tables exist. – Sameer May 15 '11 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 '11 at 20:56
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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