3

I have recently imported a database from a old host. Sadly it contained some databases with names in the following format:

#mysql50#databasename.bak

I want to remove these as they are no longer needed but calling a drop database gives me the following error:

DROP DATABASE `#mysql50#databasename.bak`
Incorrect database name

I have looked in the information_schema and the name is the same including the #s. One interesting thing I have noticed is the directories under /var/lib/mysql do not contain the #s and are in the format databasename.bak.

dmanners
  • 2,062
  • 1
  • 18
  • 24

3 Answers3

1

You can delete the database on the file level.

See: Where does MySQL store database files on Windows and what is the name of the files

Community
  • 1
  • 1
CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
1

Have you tried using a database management software as navicat or phpmyadmin in order to delete it?

Also do you have root access to the computer which got the db? You should be able to go into the mysql data dir and delete the database at a file level. My data dir is /var/lib/mysql. Inside that directory, you will see all your databases (as directories), just remove the directory named after the database.

George Chondrompilas
  • 3,167
  • 27
  • 35
  • thanks I did it the second way by removing the files under data for these databases as phpmyadmin still had the issues with the names. – dmanners Sep 11 '13 at 12:57
0

Try

DROP DATABASE `\#mysql50\#databasename.bak`

or

DROP DATABASE `##mysql50##databasename.bak`
juergen d
  • 201,996
  • 37
  • 293
  • 362