티스토리 뷰

SET FOREIGN_KEY_CHECKS = 0; 

SET @tables = NULL;

SELECT GROUP_CONCAT(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;

SET FOREIGN_KEY_CHECKS = 1; 


출처 : http://stackoverflow.com/questions/12403662/how-to-remove-all-mysql-tables-from-the-command-line-without-drop-database-permi

댓글
댓글쓰기 폼
공지사항
최근에 달린 댓글
Total
125,395
Today
21
Yesterday
13
링크
«   2021/04   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
글 보관함