How can I delete a table named "logs / # sql-ib203" that appears after a MySQL crash?

DROP TABLE logs/#sql-ib203 does not work due to / :

Error code: 1064. You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to '/ # sql-ib203' on line 1

The logs/#sql-ib203 appeared after a database failure (not enough disk space when re-indexing and deleting some attributes in the table in the logs database). SHOW TABLES does not display the logs/#sql-ib203 , but when trying to ALTER table that was modified during the crash, MySQL complains about the existence of the logs/#sql-ib203 :

ERROR 1050: The tables "logs / # sql-ib203" already exist

SQL statement:

ALTER TABLE logs . srv_logs DROP COLUMN filenum , DROP COLUMN agent , DROP COLUMN ip , DROP COLUMN event_source

I am using MySQL 5.6.12-winx64 and InnoDB.

+4
source share
2 answers

Try to do:

 DROP TABLE `logs/#sql-ib203` 

You need to wrap the name with,, which should remove it.
Best wishes.

+1
source
  • You can dump your database, a temporary table with an innodb orphan is not specified in the dump file, then you can delete the database and restore it again.

  • You can also try; drop table #mysql50##sql-ib203 ;

Link: http://dev.mysql.com/doc/refman/5.6/en/identifier-mapping.html

0
source

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


All Articles