본문 바로가기

DB/My-sql

SP, FUNC, VIEW 백업

4.5.4 mysqldump — A Database Backup Program

The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, SUPER for dumped triggers, andLOCK TABLES if the --single-transaction option is not used. Certain options might require other privileges as noted in the option descriptions.

To reload a dump file, you must have the privileges required to execute the statements that it contains, such as the appropriateCREATE privileges for objects created by those statements.

If you are doing a backup on the server and your tables all are MyISAM tables, consider using the mysqlhotcopy instead because it can accomplish faster backups and faster restores. See Section 4.6.9, “mysqlhotcopy — A Database Backup Program”.

There are three general ways to invoke mysqldump:

shell> mysqldump [options] db_name [tbl_name ...]
shell> mysqldump [options] --databases db_name ...
shell> mysqldump [options] --all-databases


'DB > My-sql' 카테고리의 다른 글

mysql import / csv파일 import mysql  (0) 2016.02.05
mysql 백업 복구  (0) 2016.02.05
MYSQL에서 원치않는 TABLE LOCK이 걸렸을 경우 해제 방법입니다.  (0) 2016.02.05
innodb lock wait timeout  (0) 2016.02.05
mysql insert into blob  (0) 2016.02.05