Mysql | How to drop table having dot (.) in the table name in MySQL

| By Webner

We had a table in our database having dot in the table name as below:

Table name – kpc.product_categories

On trying to delete kpc.product_categories using below command:

drop table kpc.product_categories

It used to give error that no such table exists.

Dot(.) is the reserved symbol in mysql so we have to avoid (.) as much as possible. But if unfortunately, we had such a table name use below sql command to drop it:

Sql Queries:

  1. SET sql_mode=’ANSI_QUOTES’;
  2. USE DATABASE  “database_name” ;
  3. DROP TABLE  “kpc.product_categories” ;

DROP TABLE kpc.product_categories 

Leave a Reply

Your email address will not be published. Required fields are marked *