How do I remove a MySQL database?

前端 未结 7 2152
傲寒
傲寒 2021-01-29 22:35

You may notice from my last question that a problem caused some more problems, Reading MySQL manuals in MySQL monitor?

My database is now unusable partly due to

7条回答
  •  無奈伤痛
    2021-01-29 22:53

    If your database cannot be dropped, even though you have no typos in the statement and do not miss the ; at the end, enclose the database name in between backticks:

    mysql> drop database `my-database`;
    

    Backticks are for databases or columns, apostrophes are for data within these.

    For more information, see this answer to Stack Overflow question When to use single quotes, double quotes, and backticks?.

提交回复
热议问题