What is a database with ".res" in its name?
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&gt; 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&gt; 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.