[mysql] Drop the database with a dash in the name
In this post, we will learn how we can delete a database in MySQL which dash [-] in name of the database.
Some day before I tried to drop the MySQL database in our production environment and we got below error.
mysql> drop database test-at;
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 ‘-at’ at line 1
How we can Drop it
we can drop this by using below command.
mysql> drop database `test-at`;
mysql> drop database `test-at`; Query OK, 41 rows affected (1.17 sec)
Done, Hope it will help you !
I am a professional Cloud Engineer and founder of LinuxFork. I am working on Infrastructure Deployment and focusing on the integration of open source technologies with the Cloud. I am an avid Linux lover and open source enthusiast. mostly, I am working with Redhat and Ubuntu Linux in the production environment. apart from this I always believe in knowledge sharing.