Removing a table in MySQL (3.23.58) with a special character in tablename

Yes, this is an old db (we are in the process of migration). One way or another, phpMyAdmin allows the user to create a table with "in it".

name: type_save '

But now I can not refuse this table. I tried this from the command line:

mysql> drop table "type_save\'";
ERROR 1064: You have an error in your SQL syntax near '"type_save\'"' at line 1                                                                          

mysql> drop table "type_save'";
ERROR 1064: You have an error in your SQL syntax near '"type_save'"' at line 1    


mysql> drop table `type_save'`;
'>                                                                                      

How do you avoid this?

Thank...

+3
source share
3 answers

MySQL 3.x, MyISAM ( ISAM). ( , ), MyISAM/ISAM, .MYI, .MYD .frm , , - . . ( , Unix, Windows , Windows . ).

, InnoDB, ISAM MyISAM.

InnoDB, , / .

, . .

+1

MySQL ?, , ,

drop table `type_save'`

, .

+8

Try the following:

mysql> drop table `type_save'`;

Note: "mysql>" is just a command line.

The `character ( reverse apostrophe or single quote).

+5
source

Source: https://habr.com/ru/post/1773915/


All Articles