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

9 posts / 0 new
Last post
#1 Tue, 05/01/2012 - 11:13
DoubleSpeed

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

Wed, 05/02/2012 - 15:57
DoubleSpeed

Can anyone advise on this?

Wed, 05/02/2012 - 17:03
Locutus

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.

Wed, 05/02/2012 - 17:06 (Reply to #3)
DoubleSpeed

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.

Wed, 05/02/2012 - 17:08
Locutus

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.

Thu, 05/03/2012 - 09:41
DoubleSpeed

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>

Thu, 05/03/2012 - 10:52
andreychek

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 :-)

Do you know how it go that way though?

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

-Eric

Thu, 05/03/2012 - 13:39
Locutus

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.

Thu, 05/03/2012 - 15:23
DoubleSpeed

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.

Topic locked