Delete data from all tables in MYSQL

前端 未结 16 1761
自闭症患者
自闭症患者 2020-12-13 09:17

I have 100 tables, 40,000 rows in each table. I want to go into MySQL and delete all rows from all tables.

...in 1 statement, if p

16条回答
  •  误落风尘
    2020-12-13 10:11

    In command line...

    USE dbname
    
    SET foreign_key_checks = 0;
    TRUNCATE tablename;  //do this for each table you want emptied
    SET foreign_key_checks = 1;
    

提交回复
热议问题