mysql 모든 table 삭제
DB & SQL 2015. 6. 23. 00:58
-- MySQL drop all tables in database
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'database_name'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
5번 라인의 'database name'에 모든 테이블을 삭제할 database 이름을 넣어줌
'DB & SQL' 카테고리의 다른 글
| linux mint13 oracle 11g express 설치 (0) | 2015.06.23 |
|---|---|
| oracle SQL*PLUS command (0) | 2015.06.23 |
| mysql 계정 및 DB 생성 (0) | 2015.06.23 |
| mysql 인코딩 utf8 적용 (0) | 2015.06.23 |
| linux ubuntu MySQL 재설치 (0) | 2015.06.23 |
