-3

How to drop database having space in-between DB Name? In my case Database name is Flight_Search DB_DEV

enter image description here

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 'db_dev' at line 1

MYSQL Version is 8.0.33

Amira Bedhiafi
  • 8,088
  • 6
  • 24
  • 60

1 Answers1

0

Based on this answer :

If you want to use something around object identifiers, use at least the standard double quotes: "

This works in MySQL, PostgreSQL, SQL Server, Oracle, etc. etc. For MySQL you might need the SQL mode ansi_quotes, depending on the default configuration:

SET sql_mode = 'ANSI_QUOTES'; Backticks ` are only used in MySQL, you learn a type of SQL that won't work in any other brand of DBMS.

CREATE DATABASE `Flight_Search DB_DEV`;
DROP DATABASE `Flight_Search DB_DEV`;

fiddle

Amira Bedhiafi
  • 8,088
  • 6
  • 24
  • 60