Oracle 5.0 Reference Manual page 650

Table of Contents

Advertisement

On Server 2:
shell>
mysqladmin create db1
shell>
mysql db1 < dump.sql
You can specify a different database name in this case, so omitting
mysqldump
7.4.5.3. Dumping Stored Programs
Several options control how
and triggers):
--routines
--triggers
The
--triggers
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
7.4.5.4. Dumping Table Definitions and Content Separately
The
--no-data
containing only statements to create the tables. Conversely, the
mysqldump
data.
For example, to dump table definitions and data separately for the
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
shell>
mysqldump --no-data --routines test > dump-defs.sql
7.4.5.5. Using
mysqldump
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:
command enables you to dump data from one database and load it into another.
mysqldump
[304]: Dump stored procedures and functions
[305]: Dump triggers for tables
[305]
option is enabled by default so that when tables are dumped, they are
[304]
[303]
option tells
mysqldump
to suppress
statements from the output, so that the dump file contains only table
CREATE
to Test for Upgrade Incompatibilities
Tips
mysqldump
handles stored programs (stored procedures and functions
or
--skip-triggers
not to dump table data, resulting in the dump file
[304]
option to also include stored routine definitions:
--routines
630
--databases
[305].
--no-create-info
database, use these
test
[299]
from the
[303]
option tells

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents