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 版

选中你要清空的表,右键

清除索引、和外

 

本文作者:念月_xy

本文链接:https://www.cnblogs.com/zero-vic/p/10504924.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   念月_xy  阅读(31334)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起