Backup using mysqldump

suggest change

Syntax

Parameters

Option Effect
-h, --host Host name or IP address to connect to. The default is localhost, which on Unix uses a local socket and is not the same as 127.0.0.1. Example: -h localhost
-u, --user MySQL user
-p, --password MySQL password. There must be no space between -p and the password. Example: -pMyPassword. Omitting the password after -p prompts for it.
--add-drop-database Add a DROP DATABASE statement before each CREATE DATABASE statement. Useful when replacing databases on the server.
--add-drop-table Add a DROP TABLE statement before each CREATE TABLE statement. Useful when replacing tables on the server.
--no-create-db Suppress CREATE DATABASE statements. Useful when the databases already exist where you will load the dump.
-t, --no-create-info Suppress CREATE TABLE statements. Useful when you want only row data for identical tables elsewhere.
-d, --no-data Do not write row data. The dump contains CREATE TABLE statements only. Useful for empty template databases.
-R, --routines Include stored procedures and functions.
-K, --disable-keys Disable keys before inserting and enable them afterward. This speeds inserts only for MyISAM tables with nonunique indexes.

Remarks

The output of a mysqldump operation is a lightly commented file containing sequential SQL statements that are compatible with the version of MySQL utilities that was used to generate it (with attention paid to compatibility with previous versions, but no guarantee for future ones). Thus, the restoration of a mysqldumped database comprises execution of those statements. Generally, this file

The presence of the DROP before CREATE for each table means that if the schema is present, whether or not it is empty, using a mysqldump file for its restoration will populate or overwrite the data therein.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents