[scrap]mysqldump 옵션 및 사용법

http://egloos.zum.com/simonshin/v/2247509

 

1. mysqldump 옵션 중 binary log 의 포지션 정보 같이 dump 하기

/usr/local/mysql/bin/mysqldump -uroot -p –master-data=2  > /data/…/backup.sql
이 명령어 중에서 “–master-data=2” 옵션을 주게 되면 덤프 시점의 binary log의 포지션 정보가 같이 Dump 되게 된다.
Dump된 파일을 에디터로 열어보면 다음과 같은 내용이 나온다.

2. Table Lock 걸기

FLUSH TABLES WITH READ LOCK; //Table Lock 걸기

UNLOCK TABLES; //Table Lock 풀기

3. Mysqldump options

mysqldump  Ver 10.9 Distrib 4.1.18, for pc-linux-gnu (i686)
By Igor Romanenko, Monty, Jani & Sinisa
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Dumping definition and data mysql database or table
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] –databases [OPTIONS] DB1 [DB2 DB3…]
OR     mysqldump [OPTIONS] –all-databases [OPTIONS]
Default options are read from the following files in the given order:
/etc/my.cnf /home/irteam/naver/mysql-4.1.18/var/my.cnf ~/.my.cnf
The following groups are read: mysqldump client
The following options may be given as the first argument:
–print-defaults
Print the program argument list and exit
x
–no-defaults
Don’t read default options from any options file
x
–defaults-file=#
Only read default options from the given file
x
–defaults-extra-file=
Read this file after the global files are read
x
-a, –all
Deprecated. Use –create-options instead.
default
-A, –all-databases
Dump all the databases. This will be same as –databases with all databases selected.

–add-drop-database
Add a ‘DROP DATABASE’ before each create.

–add-drop-table
Add a ‘drop table’ before each create.
default
–add-locks
Add locks around insert statements.
default
–allow-keywords
Allow creation of column names that are keywords.

–character-sets-dir=name
Directory where character sets are.

-i, –comments
Write additional information.
default
–compatible=name
Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.

–compact
Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs.  Enables options –skip-add-drop-table –no-set-names –skip-disable-keys –skip-add-locks

-c, –complete-insert
Use complete insert statements.

-C, –compress
Use compression in server/client protocol.

–create-options
Include all MySQL specific create options.
default
-B, –databases
To dump several databases. Note the difference in usage;
In this case no tables are given. All name arguments are regarded as databasenames. ‘USE db_name;’ will be included in the output.

-#, –debug[=#]
This is a non-debug version. Catch this and exit
x
–default-character-set=name
Set the default character set.
utf8
–delayed-insert
Insert rows with INSERT DELAYED.

–delete-master-logs
Delete logs on master after backup. This automatically enables –master-data.

-K, –disable-keys

‘/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and
‘/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put  in the output.
default
-e, –extended-insert
Allows utilization of the new, much faster INSERT syntax.
default
–fields-terminated-by=name
Fields in the textfile are terminated by …

–fields-enclosed-by=name
Fields in the importfile are enclosed by …

–fields-optionally-enclosed-by=name
Fields in the i.file are opt. enclosed by …

–fields-escaped-by=name
Fields in the i.file are escaped by …

-x, –first-slave
Deprecated, renamed to –lock-all-tables.

-F, –flush-logs
Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option –databases= or –all-databases), the logs will be flushed for each database dumped. The exception is when using –lock-all-tables or –master-data: in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you
should use –lock-all-tables or –master-data with –flush-logs

-f, –force
Continue even if we get an sql-error.

-?, –help
Display this help message and exit.

–hex-blob
Dump binary strings (BINARY, VARBINARY, BLOB) in hexadecimal format.

-h, –host=name
Connect to host.

–ignore-table=name
Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table.  Each table must be specified with both database and table names, e.g.  –ignore-table=database.table

–insert-ignore
Insert rows with INSERT IGNORE.

–lines-terminated-By=name

Lines in the i.file are terminated by …

-x, –lock-all-tables
Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns –single-transaction and –lock-tables off.

-l, –lock-tables
Lock all tables for read.
default
–master-data[=#]
This causes the binary log position and filename to be appended to the output. If equal to 1, will print it as a CHANGE MASTER command; if equal to 2, that command will be prefixed with a comment symbol. This option will turn –lock-all-tables on, unless –single-transaction is specified too (in which case a global read lock is only taken a short time at the beginning of the dump – don’t forget to read about –single-transaction below). In all cases any action on logs will happen at the exact moment of the dump.Option automatically turns –lock-tables off.
0
–max_allowed_packet

16776192
–net_buffer_length=

1047551
–no-autocommit
Wrap tables with autocommit/commit statements.

-n, –no-create-db
‘CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;’ will not be put in the output. The above line will be added otherwise, if –databases or –all-databases option was
given.}.

-t, –no-create-info
Don’t write table creation info.

-d, –no-data
No row information.

-N, –no-set-names
Deprecated. Use –skip-set-charset instead.

–opt
Same as –add-drop-table, –add-locks, –create-options, –quick, –extended-insert, –lock-tables, –set-charset, and –disable-keys. Enabled by default, disable with –skip-opt.

–order-by-primary
Sorts each table’s rows by primary key, or first unique key, if such a key exists.  Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.

-p, –password[=name]
Password to use when connecting to server. If password is not given it’s solicited on the tty.

-P, –port=#
Port number to use for connection.
3306
–protocol=name
The protocol of connection (tcp, socket, pipe, memory)

-q, –quick
Don’t buffer query, dump directly to stdout.
default
-Q, –quote-names
Quote table and column names with backticks (`).
default
-r, –result-file=name
Direct output to a given file. This option should be used in MSDOS, because it prevents new line ‘n’ from being converted to ‘rn’ (carriage return + line feed).

–set-charset
Add ‘SET NAMES default_character_set’ to the output. Enabled by default; suppress with –skip-set-charset.
default
-O, –set-variable=name
Change the value of a variable. Please note that this option is deprecated; you can set variables directly with –variable-name=value.

–single-transaction
Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. Option automatically turns off –lock-tables.

–skip-opt
Disable –opt. Disables –add-drop-table, –add-locks, –create-options, –quick, –extended-insert, –lock-tables, –set-charset, and –disable-keys.

-S, –socket=name
Socket file to use for connection.

-T, –tab=name
Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.

–tables
Overrides option –databases (-B).

-u, –user=name
User for login if not current user.

-v, –verbose
Print info about the various stages.

-V, –version
Output version information and exit.

-w, –where=name
Dump only selected records; QUOTES mandatory!

-X, –xml
Dump a database as well formed XML.

=============================================

** DETAIL SECTION

-a, –all
MySQL 고유의 작성 옵션을 모두 포함한다.

-A, –all-databases
모든 데이타베이스를 덤프 한다. 이것은 , 모든 데이타베이스를 선택한 상태로 –databases 를 실행하는 것과 같다.

–add-drop-database
/*!40000 DROP DATABASE IF EXISTS `db_char`*/; 구문 추가

–add-drop-table
DROP TABLE IF EXISTS `test`;
각 작성 스테이트먼트의 전에 drop table 를 추가한다.

–add-locks
LOCK TABLES `test` WRITE;
INSERT INTO `test` VALUES (‘刺’,1);
UNLOCK TABLES;
각 테이블 덤프의 전에 LOCK TABLES 를 추가해 , 후 에 UNLOCK TABLE 를 추가한다 (MySQL 에의 삽입을 빠르게하기 위해

–allow-keywords
`test`
키워드인 컬럼명의 작성을 인정한다. 각 컬럼명의 선두에 테이블명을 덧붙이는 것이 필요.

–character-sets-dir=name
케릭터셋 디렉토리를 지정한다.

-i, –comments
— MySQL dump 10.9

— Host: localhost    Database: xien
— ——————————————————
— Server version       4.1.18
‘–‘로 시작하는 프로그램 버전, 서버 버전, 그리고 호스트 information comments
–skip-comments
‘–‘로 시작하는 information comments 가 없어진다.

–compatible=name
구분자가 “test”로 떨어지며 oracle,db2,mssql등 다른 데이터베이스로 안정적으로 옵티마이즈 된다.

–compact
CREATE TABLE `test` (
`zzang` char(1) default NULL,
`good` int(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=euckr;
INSERT INTO `test` VALUES (‘刺’,1);

verbose(상세설명)을 제외하여 간단한 정보만 나타난다. –skip-add-drop-table –no-set-names –skip-disable-keys –skip-add-locks
디버깅에 유용하다.

-c, –complete-insert
완전한 삽입 스테이트먼트(컬럼명도 지정) 를 사용한다.
INSERT INTO `test` (`zzang`, `good`) VALUES (‘刺’,1);

-C, –compress
클라이언트와 서버의 양쪽 모두가 압축을 서포트하는 경우 , 클라이언트와 서버간의 정보를 모두 압축한다.

–create-options
CREATE TABLE `test` (
`zzang` char(1) default NULL,
`good` int(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=euckr;
create 옵션이 추가된다.

-B, –databases
몇개의 데이타베이스를 덤프 한다. 주의:여기에서는 , 테이블명을 지정하지 않는다. 이름의 인수는 모두 , 데이타베이스명으로서 다루어진다. 출력되는 각 신규 데이타베이스의 전에 USE db_name; 가 추가된다.

-#, –debug[=#]
디버깅 로그를 작성한다. debug_options 스트링은 종종 ‘d:t:o,file_name’가 된다. 디폴트는 ‘d:t:o,/tmp/mysqldump.trace’.

–default-character-set=name (default utf8)
–default-character-set=euckr
INSERT INTO `test` VALUES (‘황’,1);

–delayed-insert
INSERT DELAYED 커멘드로 레코드를 삽입한다.
INSERT  DELAYED INTO test (zzang, good) VALUES (‘刺’,1);

–delete-master-logs
마스터 리플리케이션 서버에서, 덤프 연산을 실행한 후에 바이너리 로그를 삭제한다. 이 옵션은 자동으로 –master-data를 활성화 시킨다.

-K , –disable-keys
/*!40000 ALTER TABLE test DISABLE KEYS */;
INSERT  DELAYED INTO test (zzang, good) VALUES (‘刺’,1);
/*!40000 ALTER TABLE test ENABLE KEYS */;
이것에 의해 , 인덱스가 , 모든 데이터가 삽입 빗나간 후 에 작성되기 때문에 ,MySQL 서버에의 데이터의 로드가 빨라진다. 이 옵션은 MyISAM 테이블에 대해서만 효과가 있다.

-e, –extended-insert
여러 개의 VALUES 리스트를 가지고 있는 다중-열 INSERT 신텍스를 사용한다. 이렇게 하면 덤프 파일이 작아지고 파일을 다시 읽어 올 때 삽입 속도를 빠르게 할 수가 있다.

–fields-terminated-by=name
–fields-enclosed-by=name
–fields-optionally-enclosed-by=name
–fields-escaped-by=name
–lines-terminated-By=name
이러한 옵션은 -T 옵션과 함께 사용한다. LOAD DATA INFILE 의 대응하는 마디와 같은 의미를 가진다.

-x, –first-slave
모든 데이타베이스의 모든 테이블을 락.
기능 삭제됨. 현재는 –lock-all-tables로 바뀌었음.

-F, –flush-logs
덤프를 개시하기 전에 ,MySQL 서버내의 로그 파일을 플래시 한다. 주의: 이 옵션을 –all-databases(또는 -A) 옵션과 조합해 사용했을 경우 , 로그는각 데이타베이스의 덤프 마다플래시 된다.
한가지 예외는 –lock-all-tables 또는 –master-data를 사용하는 경우이다: 이와 같은 경우, 로그는 모든 테이블이 잠기는 시점에 오직 한번만 플러시된다. 만일 동일한 시점에 덤프 및 로그 플러시가 일어나도록 하기 위해서는, –flush-logs를 –lock-all-tables 또는 –master-data와 함께 사용하도록 한다.

-f, –force
테이블 덤프중에SQL 에러가 발생해도 속행한다.

-?, –help
헬프 메세지를 표시해 종료한다.

–hex-blob
16진법(hexadecimal)을 사용해서 바이너리 컬럼을 덤프한다 (예를 들면, ‘abc’는 0x616263가 된다). 이렇게 할 수 있는 데이터 타입은 BINARY, VARBINARY, BLOB 이다. MySQL 5.0.13까지는, BIT 컬럼도 해당된다.

-h, –host=name
지정한 호스트의 MySQL 서버로부터 데이터를 덤프 한다. 디폴트의 호스트는 localhost.

–ignore-table=xien.test
xien db의 test table 은 dump하지 않는다.

–insert-ignore
INSERT 명령문을 IGNORE 옵션과 함께 작성한다.

-x, –lock-all-tables
모든 데이터 베이스에 걸쳐서 모든 테이블을 잠근다. 이것은 전체 덤프 주기에 대한 글로벌읽기 잠금을 통해 얻을 수 있다. 이 옵션은 자동으로 –single-transaction –lock-tables를 오프(Off)시킨다.

-l, –lock-tables
덤프를 하기 전에 모든 테이블을 잠근다. MyISAM 테이블의 경우에는 동시 삽입을 허용하기 위해서 테이블을 READ LOCAL로 잠근다. InnoDB 및 BDB와 같은 트랜젝션이 되는 테이블의 경우, –single-transaction이 보다 좋은 옵션이 되는데, 그 이유는 이것은 테이블을 전혀 잠글 필요가 없기 때문이다.
여러 개의 데이터 베이스를 덤프할 때에는, –lock-tables은 각각의 데이터 베이스에 대해서 테이블을 개별적으로 잠근다는 점을 알아두기 바란다. 따라서, 이 옵션은 덤프 파일에 있는 테이블이 데이터 베이스간에 논리적으로 일관성을 가지는 것에 대해서는 보장을 하지 않는다. 서로 다른 데이터 베이스에 있는 테이블들은 완벽하게 틀린 상태에서 덤프가 된다.
–master-data[=#]
바이너리 로그 파일 이름과 위치(position)을 결과에 작성한다. 이 옵션은 RELOAD 권한이 필요하고 바이너리 로그는 반드시 활성화 되어야 한다. 만일 이 옵션 값이 1 이면, 그 위치 및 파일 이름은 CHANGE MASTER 명령문 형태로 덤프 결과에 작성되는데, 이것은 슬레이브를 설정하기 위해 이 SQL 덤프를 사용하는 경우에 슬레이브 서버로 하여금 마스터의 바이너리 로그에 있는 올바른 위치에서 시작을 하도록 만든다. 만일 이 옵션 값이 2와 같다면, CHANGE MASTER 명령문은 SQL 코멘트처럼 작성된다. 만일 값이 생략되면, 이것이 디폴트 동작이 된다.
–master-data 옵션은 –single-transaction을 함께 지정하지 않는 한, –lock-all-tables를 온(ON) 시킨다 (이와 같은 경우, 글로벌 읽기 잠금은 덤프가 시작되는 짧은 시점에만 얻을 수 있다). –single-transaction에 대한 설명을 함께 참조한다. 모든 경우에, 로그 상의 모든 동작은 정확히 덤프가 일어나는 시점에 발생을 한다. 이 옵션은 자동으로 –lock-tables를 오프(Off) 시킨다.
–max_allowed_packet
클라이언트/서버 통신용 버퍼의 최대 크기. 최대 크기는 1GB.

–net_buffer_length=
복수 레코드 삽입 스테이트먼트를 작성했을 때에 (–extended-insert 옵션 또는 –opt 옵션과 같이 ) ,mysqldump 는 net_buffer_length 까지 의 길이의 레코드를 작성한다. 이 변수를 크게 하는 경우에는 ,MySQL 서버의 max_allowed_packet 변수가 net_buffer_length 보다 큰 것을 확인한다.

–no-autocommit
set autocommit=0;
INSERT INTO `test` VALUES (‘刺’,1);
commit;
각각의 덤프된 테이블에 대한 INSERT 명령문을 SET AUTOCOMMIT=0 과COMMIT 명령문안에 넣는다.

-n, –no-create-db ( -A 사용의 경우 )
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db_char` /*!40100 DEFAULT CHARACTER SET latin1 */; 이 없어진다.
하지만 –databases 옵션 또는 –all-databases 옵션을 지정했을 경우는 , 상기의 행이 추가된다.

-t, –no-create-info
테이블 작성 정보(CREATE TABLE 스테이트먼트) 를 기입하지 않는다.

-d, –no-data
테이블의 레코드 정보를 모두 기입하지 않는다. 테이블의 구조만을 덤프 하는 경우 , 매우 편리하다.

-N, –no-set-names

–opt
–quick –add-drop-table –add-locks –extended-insert –lock-tables 와 같다. MySQL 서버에 읽어들이기 위한 최고 속도 덤프를 제공한다.

–order-by-primary
주요(primary) 키 또는 맨 처음의 유니크 인덱스(만일 인덱스가 존재한다면)를 사용해서 각각의 테이블 열을 정렬한다. 이것은 InnoDB 테이블 안으로 집어넣을 MyISAM 테이블을 덤프할 때 유용하게 사용되지만, 덤프 자체를 매우 오래 걸리게 한다.

-p, –password[=name]
서버 접속시에 사용하는 패스워드. ‘=your_pass’ 부분을 지정하지 않으면 ,mysqldump 에 의해 패스워드의 prompt가 표시된다.

-P, –port=#
TCP/IP 접속에 사용하는 포토 번호

–protocol=name
사용하는 접속 프로토콜을 지정한다.

-q, –quick
쿼리를 버퍼 하지 않고 ,stdou 에 직접 덤프 한다. 이것을 실시하려면,mysql_use_result() 를 사용한다. 큰 덤프 시에 특히 편리하다.

-Q, –quote-names
CREATE TABLE `test` (
`zzang` char(1) default NULL,
`good` int(1) default NULL
);
테이블명 및 컬럼명을 ‘`' 문자로 둘러싼다.

–skip-quote-name
CREATE TABLE test (
zzang char(1) default NULL,
good int(1) default NULL
);

-r, –result-file=name
mysqldump db > db.sql 이렇게 하지 않아도
mysqldump db –result-file=db 이렇게 파일로 떨어뜨릴 수 있다.

지정한 파일에의 직접 출력. 이 옵션은 MSDOS 으로 사용한다. 개행 ‘n’ 이 ‘nr'(개행 + 복귀) 에 변환되는 것을 막기 때문에 있다.

–set-charset
/*!40101 SET NAMES utf8 */;
SET NAMES default_character_set를 결과에 추가한다. 이 옵션은 디폴트로 활성화 된다. SET NAMES 명령문을 무시하기 위해서는, –skip-set-charset를 사용한다.

–skip-set-charset
/*!40101 SET NAMES utf8 */; 부분이 없어진다.

-O, –set-variable=name
변수의 값을 지정한다. 지정 가능한 변수는 이하에 나타낸다.
주의: –set-variable=name=value 및 -O name=value 구문은 ,MySQL 4.0부터 폐지. 대신에 –name=value 를 사용하는 것.

–single-transaction
이 옵션은 , 서버로부터 데이터를 덤프 하기 전에 ,BEGIN SQL 커멘드를 발행한다. 이것은 ,InnoDB 테이블과 READ_COMMITTED 트랜잭션(transaction) 분리 레벨로 특별히 도움이 된다. 이 모드에서는 , 어느 어플리케이션도 블록 하는 일 없이 ,BEGIN 가 발행되었을 때의 데이타베이스의 정합한 상태를 덤프 할 수 있다.

이 옵션을 사용할 때는 , 트랜잭션(transaction) 테이블만이 정합 상태로 덤프 되는 것에 주의한다. 예를 들면 , 이 옵션으로 덤프 된 MyISAM 테이블 또는 HEAP 테이블은 , 변경되고 있을 가능성이 있다.

–single-transaction 옵션은 버젼 4.0.2 으로 추가되었다. 이 옵션은 –lock-tables 옵션과는 상호 배타적이다. LOCK TABLES (은)는 , 전의 트랜잭션(transaction)를 벌써 위탁하고 있기 때문에 있다.

–skip-opt

-S, –socket=name
localhost(디폴트 호스트) (와)과의 접속에 사용하는 소켓 파일

-T, –tab=name
각 테이블에 대한 SQL CREATE 커멘드가 포함되는 table_name.sql 파일 , 및 각 테이블에 대한 데이터가 포함되는 table_name.txt 파일을 작성한다. .txt 파일의 형식은 ,–fields-xxx 옵션 및 –lines–xxx 옵션에 근거한다. 주의: 이 옵션은 ,mysqldump 이 mysqld demon와 같은 머신으로 실행하고 있는 경우만 유효. FILE 권한이 있는 MySQL 어카운트를 사용하는 것이 필요. 그리고 ,mysqld 를 실행하고 있는 로그인 유저 또는 그룹(통상은 유저 mysql, 그룹 mysql) 에 , 지정한 장소에서의 파일의 작성 및 기입해 권한이 필요

–tables
–databases(-B) 옵션을 덧쓰기한다

-u, –user=name
서버와의 접속에 사용하는 MySQL 유저명. 디폴트치는 유저의 Unix 로그인명

-v, –verbose
프로그램의 실행 내용에 관한 상세 정보를 출력한다.

-V, –version
mysqldump  Ver 10.9 Distrib 4.1.18, for pc-linux-gnu (i686)
버젼 정보를 출력해 종료한다.

-w, –where=name

–where=good

— Dumping data for table `test`

— WHERE:  good
INSERT INTO `test` VALUES (‘刺’,1);
선택한 레코드만을 덤프 한다. 주의: 반드시 인용부호로 둘러싸는 것

-X, –xml
1 개의 데이터베이스를 정형식의 XML로 덤프.
<?xml version=”1.0″?>
<mysqldump xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“>
<database name=”xien”>
<table_structure name=”test”>
<field Field=”zzang” Type=”char(1)” Null=”YES” Key=”” Extra=”” />
<field Field=”good” Type=”int(1)” Null=”YES” Key=”” Extra=”” />
</table_structure>
<table_data name=”test”>
<row>
<field name=”zzang”>刺</field>
<field name=”good”>1</field>
</row>
</table_data>
</database>
</mysqldump>

–tz-utc
SET TIME_ZONE=’+00:00’를 덤프 파일에 추가해서 TIMESTAMP 컬럼이 서로 다른 타임 존에 있는 서버간에 덤프되고 리로드될 수 있도록 한다. 이 옵션을 사용하지 않으면, TIMESTAMP 컬럼은 로컬 및 목적 서버의 타임 존에 덤프 및 리로드 되고, 이 결과로 인해 값이 변하게 된다. –tz-utc는 디폴트로 활성화 되어 있고, –skip-tz-utc를 사용해서 비활성화 시킬 수가 있다. 이 옵션은 MySQL 5.0.15 에서 추가 되었다
–triggers
각각의 덤프 테이블에 대한 트리거를 덤프한다. 이 옵션은 디폴트로 활성화 되어 있다; –skip-triggers로 비 활성화 시킬 수 있다.이 옵션은 MySQL 5.0.11 에 추가 되었다. 이전에는, 트리거를 덤프할 수 없었다.
–routines, -R
덤프된 데이터 베이스에서 스토어드 루틴(함수 및 프로시저)를 덤프한다. –routines을 사용해서 만들어지는 결과는 CREATE PROCEDURE 루틴을 재 생성하기 위한 CREATE FUNCTION 명령문을 갖게 된다. 하지만, 이러한 명령문들은 루틴 생성 및 수정 타임 스탬프와 같은 속성을 가지지 않는다. 이것은 루틴이 리로드(reload)될 때, 리로드 시간과 동일한 타임 스탬프를 가지고서 생성된다는 것을 의미한다.
만일 재 생성될 루틴이 원래의 타임 스탬프 속성을 가지도록 하기 위해서는, –routines를 사용하지 말도록 한다. 대신에, mysql 데이터 베이스에 대해 적절한 권한을 가지고 있는 MySQL 계정을 사용해서 mysql.proc 테이블의 내용물을 직접 덤프 및 리로드 하도록 한다.
이 옵션은 MySQL 5.0.13 에 추가되었다. 이 버전 이전에는 스토어드 루틴을 덤프할 수가 없었다. 루틴 DEFINER 값은 5.0.20 이후에 덤프가 되었다. 이것은 5.0.20 이전에는, 루틴이 리로드될 때, 리로딩 사용자에 대해서 디파이너(definer) 셋을 가지고 생성된다는 것을 의미하는 것이다. 만일 루틴이 원래의 디파이너를 가지고 재 생성되도록 하고자 한다면, 앞에서 설명한 방식으로 mysql.proc 테이블의 내용물을 직접 덤프 및 로드한다.