tables
Creates a dump of the specified database tables.
where
Dumps only records meeting a specified
WHERE
clause.
You can use mysqldump in four main ways (assume you want to get the database dump in the file
outputfile.sql):
• To make a backup of all the
databases on a MySQL server, use the command
mysqldump --user=root --password=the_mysql_root_password \ --result-file=outputfile.sql --all-databasesThis
dumps CREATE DATABASE, USE,
CREATE TABLE, and
INSERT
statements for all data in all databases that are accessible by the user root. If you specify a user other than root, the output is affected by the privileges of that user To make
a backup of specific databases, use the command
mysqldump --user=root --password=the_mysql_root_password \ --result-file=outputfile.sql --databases database_nameThis dumps CREATE DATABASE, CREATE TABLE, and
INSERT
statements for only the specified databases. Use this if you want a CREATE DATABASE
statement, in preference to the variant we showed you at the beginning of this section.
You can list several databases one after the other in the command. For example,
to dump the
music and wedding databases, you would type
mysqldump --user=root --password=the_mysql_root_password \ --result-file=outputfile.sql -databases music wedding• To make a backup of specific
tables from a database, use the command
mysqldump --user=root --password=the_mysql_root_password \ --result-file=outputfile.sql database_name table_nameYou can list several tables, one after the other, in the command To make a backup of specific data
from a table in a database, use the command
mysqldump --user=root --password=the_mysql_root_password \Share with your friends: