您的位置:首页 > 数据库 > SQL

Drop all tables in MySQL database

2014-11-18 13:42 537 查看
Drop all tables in MySQL database

Answer:

MySQL does not have a command for removing all database table(s) without dropping the database, to do so, you need the following tricks:

# mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE]
| grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]


Related posts:

Dump the table schema of a MySQL database

Export MySQL database as CSV file

How to rename database in MySQL

How to dump an MySQL/InnoDB database

Drop a database in MongoDB

http://www.linuxask.com/questions/drop-all-tables-in-mysql-database
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: