덤프란?
What dump is?
주기억 장치의 내용을 그대로 화면이나 프린터, 파일 따위로 출력하는 일.
A work printing file or printer, screen ccontent of a main memory as it is.
이는 기억 장치의 내용을 확인하기 위한 것으로 주로 오류 수정 목적으로 사용된다.
Using mysqldump for Backups
이 구간은 SQL-format dump file을 만들기 위해서 mysqldump를 어떻게 사용하는지 묘사한다.
mysqldump [arguments] > file_name
To dump all databases, invoke mysqldump with the --all-databases option:
mysqldump --all-databases > dump.sql
To dump only specific databases, name them on the command line and use the --databases option
mysqldump --databases db1 db2 db3 > dump.sql
To dump a single database, name it on the command line.
mysqldump --databases test > dump.sql
In teh single-database case, it is permissible to omit the --databases option:
mysqldump test > dump.sql
mysqldump 명령어를 실행하기 위해서는 mysql이 설치되어있는 곳에 bin 폴더로 간다.
c:\program Files\MySQL\MySQL Server 5.5\bin
그중 mysqldump.exe 가 있으므로 이용하자.
명령어는
mysqldump -u DB계정명 -p 백업대상데이터베이스명 > 저장할파일명
mysqldump -u root -p vlfreelib > c:\mysql\backup.sql
복구 명령어는
mysql -u root -p vlfreelib < c:\mysql\backup.sql
옵션설명(Option description)
-u: 사용자명을 입력 할 것임
-p: 비밀번호를 입력 할 것임
-d: 데이타 덤프 안함
-w: WHERE절을 입력함 (단일 따옴표인 것에 주의)
-h: 호스트 (Localhost 일 경우 생략가능)
2011년 5월 16일 월요일
피드 구독하기:
글 (Atom)