查找MySQL数据库中的所有表的名称并清空数据表

xiaoxiao2021-02-28  51

mysql> select CONCAT('truncate TABLE ',table_schema,'.',TABLE_NAME, ';') from INFORMATION_SCHEMA.TABLES where  table_schema in ('dd');

mysql>    truncate TABLE dd.zyx_admin;                                               truncate TABLE dd.zyx_admin_issued;                                        truncate TABLE dd.zyx_band;                                                truncate TABLE dd.zyx_baodansq;                                            truncate TABLE dd.zyx_baodanzx;                            

                truncate TABLE dd.zyx_buy_stocks; 

数据库(dd)中表就被清空了

转载请注明原文地址: https://www.6miu.com/read-2614356.html

最新回复(0)