方法1:重建库和表
用mysqldump --no-data把建表SQL导出来,然后drop database再create database,执行一下导出的SQL文件;

方法2:生成清空所有表的SQL

select CONCAT('TRUNCATE TABLE ',table_name,';') from information_schema.tables where TABLE_SCHEMA = 'db1'

导出到文件
select CONCAT('TRUNCATE TABLE ',table_name,';') into outfile '/website/truncatetable.sql' from information_schema.tables where TABLE_SCHEMA = 'db1'

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-11-22
  • 2022-01-17
  • 2021-09-23
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案