![background image](http://html1.mh-extra.com/html/oracle/5-0/5-0_reference-manual_1646196650.webp)
mysqldump
Tips
630
On Server 2:
shell>
mysqladmin create db1
shell>
mysql db1 < dump.sql
You can specify a different database name in this case, so omitting
--databases
[299]
from the
mysqldump
command enables you to dump data from one database and load it into another.
7.4.5.3. Dumping Stored Programs
Several options control how
mysqldump
handles stored programs (stored procedures and functions
and triggers):
•
--routines
[304]
: Dump stored procedures and functions
•
--triggers
[305]
: Dump triggers for tables
The
--triggers
[305]
option is enabled by default so that when tables are dumped, they are
accompanied by any triggers they have. The other options are disabled by default and must be
specified explicitly to dump the corresponding objects. To disable any of these options explicitly, use its
skip form:
--skip-routines
[304]
or
--skip-triggers
[305]
.
7.4.5.4. Dumping Table Definitions and Content Separately
The
--no-data
[303]
option tells
mysqldump
not to dump table data, resulting in the dump file
containing only statements to create the tables. Conversely, the
--no-create-info
[303]
option tells
mysqldump
to suppress
CREATE
statements from the output, so that the dump file contains only table
data.
For example, to dump table definitions and data separately for the
test
database, use these
commands:
shell>
mysqldump --no-data test > dump-defs.sql
shell>
mysqldump --no-create-info test > dump-data.sql
For a definition-only dump, add the
--routines
[304]
option to also include stored routine definitions:
shell>
mysqldump --no-data --routines test > dump-defs.sql
7.4.5.5. Using
mysqldump
to Test for Upgrade Incompatibilities
When contemplating a MySQL upgrade, it is prudent to install the newer version separately from your
current production version. Then you can dump the database and database object definitions from the
production server and load them into the new server to verify that they are handled properly. (This is
also useful for testing downgrades.)
On the production server:
shell>
mysqldump --all-databases --no-data --routines > dump-defs.sql
On the upgraded server:
shell>
mysql < dump-defs.sql
Because the dump file does not contain table data, it can be processed quickly. This enables you to
spot potential incompatibilities without waiting for lengthy data-loading operations. Look for warnings or
errors while the dump file is being processed.
After you have verified that the definitions are handled properly, dump the data and try to load it into the
upgraded server.
On the production server:
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...