Mysql – a database with “.res” in its name

innodbMySQL

I'm not that experienced with MySQL and I'm trying to fix some databases.

In mysql, a "SHOW DATABASES" shows (among others) the main database "MainDB" and another database "MainDB.res". If I'm trying to DUMP or USE that second database (with `` around the name), I get the error
ERROR 1102 (42000): Incorrect database name 'MainDB.res'.
Dumping the MainDB works without problems. Now I'm wondering if MainDB.res is some special or maybe auto-generated database that the MySQL admin has no rights for? How can I look into that database?


Detailed information:
Originally I wanted to see all ibfk connections between all tables.
Now I'm searching for a bug in the databases because I can't look into information_schema, as a
mysql> SELECT * FROM information_schema.KEY_COLUMN_USAGE;
results in the error message
ERROR 1103 (42000): Incorrect table name 'accessgroup'
and I read some forum posts suggesting that the error happens because more than one table was found with that name, and renaming it may solve the problem. That is the reason I wanted to take a look at "MainDB.res" in the first place…

EDIT:

MainDB.res/ is indeed a direcory (in /var/lib/mysql/) containing some, but not all files in the directory MainDB/. Some missing files are of type .frm, some of .MYD and .MYI. 'accessgroup.frm' is in both directories. (I can't anonymize the output of ls -l enough to paste it here.) I'll try what happens if I move the directoy MainDB.res somewhere else.

Best Answer

The MainDB.res is not the Actual database.Someone by mistake have created it in your data directory.

Have a look at the content of my datadir

-rwx------ 1 mysql mysql     0 2012-05-23 14:48 debian-5.1.flag
drwx------ 2 mysql mysql  4096 2012-05-28 16:09 mysql
-rwx------ 1 mysql mysql     6 2012-05-23 14:49 mysql_upgrade_info
-rw-rw---- 1 mysql mysql     5 2012-05-29 09:15 OSS-240.pid
drwx------ 2 mysql mysql 36864 2012-05-28 16:58 test
drwx------ 2 mysql mysql  4096 2012-05-29 10:39 world
drwxr-xr-x 2 mysql mysql   4096 2012-05-29 14:29 world.res

where world.res is the directory which i have created as

mkdir world.res

and now when i want to acess it in the MySQL Shell see the result(The world.res is created as #mysql50#world.res by itself. )

mysql> use #mysql50#world.res
ERROR 1102 (42000): Incorrect database name '#mysql50#world.res'

So in my opinion the MainDB.res is not the database.

UPDATE

In MySQL you can't create the Database's that contains the word "."

mysql> create database test.res;
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 '.res' at line 1

so it is sure that that was not your database.