Db 내 모든 테이블 삭제 Query
우선 삭제할 테이블들이 속한 db명을 아래 WHERE 구절에 넣어줍시다.[ all_delete_table.sql ]
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'DB이름';
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
[ command line ] $ mysql db_name < all_delete_table.sql > output
HAHWULSecurity engineer, Gopher and H4cker! |
0 개의 댓글:
Post a Comment