码迷,mamicode.com
首页 > 数据库 > 详细

mysql 总结

时间:2017-03-11 17:40:45      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:for   where   删除   localhost   from   命令行   拷贝   rom   名称   

1. 删除mysql下某个数据库的所有表,不删除数据库,通过下面的查询语句查询出所有drop table语句,然后把drop table语句拷贝到命令行执行。

[root@localhost ~]# mysql -uroot -p
Enter password:

mysql> select concat(‘DROP TABLE IF EXISTS ‘,table_name,‘;‘) from information_schema.tables where table_schema=‘mydb‘; //mydb数据的是要删除所有表的数据库名称。

mysql 总结

标签:for   where   删除   localhost   from   命令行   拷贝   rom   名称   

原文地址:http://www.cnblogs.com/xhkj/p/6535561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!