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 版

选中你要清空的表,右键

清除索引、和外

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM