mysql 之 清空表中数据

 

清空表的时候注意外键约束

 

命令版

查询数据库中所有表名
select table_name from information_schema.tables where table_schema='DB_name' and table_type='base table';

查询指定数据库中指定表的所有字段名column_name
select column_name from information_schema.columns where table_schema='DB_name' and table_name='users'

清空数据库中某表的数据

truncate table 表名 ;


 navicat 版

选中你要清空的表,右键

清除索引、和外

 

posted @ 2019-03-10 12:40  念月_xy  阅读(31309)  评论(0编辑  收藏  举报