Backup
To save an existing database it is recommended that you create a dump.- To dump all databases you must run the command:
mysqldump --user=****** --password=****** -A > /path/to/file_dump.SQL
- To dump several specific databases you must run the command:
mysqldump --user=****** --password=****** db_1 db_2 db_n> /path/to/file_dump.SQL
- To dump all tables from a database you must run the command:
mysqldump --user=****** --password=****** db > /path/to/file_dump.SQL
- To dump specific tables from a database you must run the command:
mysqldump --user=****** --password=****** db --tables tab1 tab2 > /path/to/file_dump.SQL
For each of the following commands you must specify a user (user) and password (password) with administrator rights on the database.
Restore your database
To restore a dump just launch the command:mysql --user=****** --password=****** db_name < /path/to/file_dump.SQL
No comments:
Post a Comment