mysqldump
— A Database Backup Program
304
The connection protocol to use for connecting to the server. It is useful when the other connection
parameters normally would cause a protocol to be used other than the one you want. For details on
the permissible values, see
Section 4.2.2, “Connecting to the MySQL Server”
.
•
--quick
[304]
,
-q
This option is useful for dumping large tables. It forces
mysqldump
to retrieve rows for a table from
the server a row at a time rather than retrieving the entire row set and buffering it in memory before
writing it out.
•
--quote-names
[304]
,
-Q
Quote identifiers (such as database, table, and column names) within “
`
” characters. If the
ANSI_QUOTES
[535]
SQL mode is enabled, identifiers are quoted within “
"
” characters. This option
is enabled by default. It can be disabled with
--skip-quote-names
[304]
, but this option should
be given after any option such as
--compatible
[299]
that may enable
--quote-names
[304]
.
•
--result-file=file_name
[304]
,
-r file_name
Direct output to a given file. This option should be used on Windows to prevent newline “
\n
”
characters from being converted to “
\r\n
” carriage return/newline sequences. The result file is
created and its previous contents overwritten, even if an error occurs while generating the dump.
•
--routines
[304]
,
-R
Include stored routines (procedures and functions) for the dumped databases in the output. Use of
this option requires the
SELECT
[578]
privilege for the
mysql.proc
table. The output generated
by using
--routines
[304]
contains
CREATE PROCEDURE
and
CREATE FUNCTION
statements
to re-create the routines. However, these statements do not include attributes such as the routine
creation and modification timestamps. This means that when the routines are reloaded, they will be
created with the timestamps equal to the reload time.
If you require routines to be re-created with their original timestamp attributes, do not use
--
routines
[304]
. Instead, dump and reload the contents of the
mysql.proc
table directly, using a
MySQL account that has appropriate privileges for the
mysql
database.
This option was added in MySQL 5.0.13. Before that, stored routines are not dumped. Routine
DEFINER
values are not dumped until MySQL 5.0.20. This means that before 5.0.20, when routines
are reloaded, they will be created with the definer set to the reloading user. If you require routines
to be re-created with their original definer, dump and load the contents of the
mysql.proc
table
directly as described earlier.
•
--set-charset
[304]
Add
SET NAMES default_character_set
to the output. This option is enabled by default. To
suppress the
SET NAMES
statement, use
--skip-set-charset
[304]
.
•
--single-transaction
[304]
This option sets the transaction isolation mode to
REPEATABLE READ
and sends a
START
TRANSACTION
SQL statement to the server before dumping data. It is useful only with transactional
tables such as
InnoDB
and
BDB
, because then it dumps the consistent state of the database at the
time when
START TRANSACTION
was issued without blocking any applications.
When using this option, you should keep in mind that only
InnoDB
tables are dumped in a consistent
state. For example, any
MyISAM
or
MEMORY
tables dumped while using this option may still change
state.
While a
--single-transaction
[304]
dump is in process, to ensure a valid dump file (correct
table contents and binary log coordinates), no other connection should use the following statements:
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...