Command for dropping a specific MySQL database [closed]

*爱你&永不变心* 提交于 2020-03-06 09:27:13

问题


In phpmyadmin, we can drop a specific database from operation tab and by hitting "DROP THE DATABASE (DROP)". But I need to drop a specific database using command prompt or terminal.


回答1:


Use mysqladmin like

mysqladmin -uroot -pyourpassword drop database_name

In this case User: root with password: yourpassword will delete database database_name

You will get a warning and have to verify it




回答2:


Have you tried this command?

DROP DATABASE databasename;

You can read more here: https://www.w3schools.com/sql/sql_drop_db.asp




回答3:


You can try this

DROP DATABASE database;

https://dev.mysql.com/doc/refman/5.7/en/drop-database.html



来源:https://stackoverflow.com/questions/59882070/command-for-dropping-a-specific-mysql-database

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!