/usr/bin/mysqlshow: Incorrect database name 'mysql.old'

When I click on the MySQL Server in Webmin I am getting:

/usr/bin/mysqlshow: Incorrect database name ‘mysql.old’

I tried deleting this database however I get…

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘‘mysql.old’’ at line 1

What is going on?

Can anyone advise on this?

An odd error, nothing I’ve ever seen. The first thing I’d try is restarting MySQL. Then check its data directory, if there is really a database named “mysql.old”. See if there are some corrupt files maybe. Also check the syslog for anything MySQL might note there.

I’ve tried rebooting MySQL a couple of times and there is a database there with no tables however I cannot seem to delete it.

How did you try to delete it? What happens when you do so? Don’t rely solely on what Webmin shows you, but check the data directory of MySQL using SSH.

Tried SSH and I get…

mysql> drop database mysql.old;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘.old’ at line 1

mysql>

Do you know how you ended up with “mysql.old” as a database name?

That’s not actually a legal name for a database.

The MySQL docs here mention this:

Database and table names cannot contain “/”, “\”, “.”, or characters that are not permitted in file names

http://dev.mysql.com/doc/refman/5.0/en/identifiers.html

So the reason you can’t delete it is because that should never happen in the first place :slight_smile:

Do you know how it go that way though?

Did someone by chance rename the database dir on the filesystem, outside of MySQL?

-Eric

I meant physically deleting the directory where the database files reside. At least for MyISAM that works, since there the structure plus data resides in a subdirectory with the DB’s name. For InnoDB though you’re out of luck, since that uses a central storage file for the data.

Before you delete anything though, make sure it doesn’t contain data you still need. Moving it out of the MySQL data directory might be a good start.

I have no idea how I got this database name however I have now just renamed the /var/lib/mysql/mysql.old to mysql_old and this has resolved the issue as I can now access the server via Webmin, thatks for your feedback on this.