使用navicat 软件
1.db_game 为要清空的数据库
select CONCAT('truncate TABLE ',table_schema,'.',TABLE_NAME, ';')
from INFORMATION_SCHEMA.TABLES where table_schema in ('db_game');
执行结果:
![](https://img.haomeiwen.com/i11628351/71abc67a9815be81.png)
-
选中复制步骤一的执行结果,再打开个新的查询窗口,粘贴执行。
image.png
1.db_game 为要清空的数据库
select CONCAT('truncate TABLE ',table_schema,'.',TABLE_NAME, ';')
from INFORMATION_SCHEMA.TABLES where table_schema in ('db_game');
执行结果:
选中复制步骤一的执行结果,再打开个新的查询窗口,粘贴执行。
本文标题:Mysql清空某个数据库下的所有表的数据
本文链接:https://www.haomeiwen.com/subject/tclqqctx.html
网友评论