mysqlsqlsyntax-errorddldrop-table

MySQL drop a Table Named "trigger"


I just created a MySQL Table called "trigger". The Problem now: I want to "drop table trigger;" This is not working. (Syntax error...) because it recognizes trigger not as name but as a trigger.

How do I do drop a table Named "trigger"?


Solution

  • You can escape a name with backticks. In your case:

    DROP TABLE `trigger`;