#backup all databases in one file (eventually add the option --add-locks):
mysqldump -u username -p -–all-databases > file.sql
#backup all databases in one gzipped file:
mysqldump -u username -p -–all-databases | gzip > file.sql.gz
#restore all databases:
mysql -u username -p < file.sql
#single database
mysqldump database_name > database_name.sql
#Multiple databases can be backed up at the same time:
mysqldump --databases database_one database_two > two_databases.sql
https://snipt.net/danfreak/backup-and-restore-all-mysql-databases-with-2-simple-commands/
Комментариев нет:
Отправить комментарий