Using the command:
CREATE TABLE IF NOT EXISTS `test`.`t1` (
`col` VARCHAR(16) NOT NULL
) ENGINE=MEMORY;
Running this twice in the MySQL Que
I had a similar Problem as @CraigWalker on debian: My database was in a state where a DROP TABLE
failed because it couldn't find the table, but a CREATE TABLE
also failed because MySQL thought the table still existed. So the broken table still existed somewhere although it wasn't there when I looked in phpmyadmin.
I created this state by just copying the whole folder that contained a database with some MyISAM
and some InnoDB
tables
cp -a /var/lib/mysql/sometable /var/lib/mysql/test
(this is not recommended!)
All InnoDB tables where not visible in the new database test
in phpmyadmin.
sudo mysqladmin flush-tables
didn't help either.
My solution: I had to delete the new test database with drop database test
and copy it with mysqldump
instead:
mysqldump somedatabase -u username -p -r export.sql
mysql test -u username -p < export.sql