msql: How to Backup and Restore mysql databases

BACKUP specific database „database_name”:
mysqldump -u username -p database_name > backup_name.sql

BACKUP all databases:
# mysqldump -u root -p –all-databases > mysqldump.sql

Without events
# mysqldump -u root -p –all-databases –events > mysqldump.sql

or with compress:
# mysqldump -u root -p –all-databases | gzip > mysqldump.sql.gz

———————————————————————————

Restore specific database „database_name” from file „only_one_database_name.sql”:
# mysql -u username -p database_name < only_one_database_name.sql

RESTORE all databases from file „mysqldump_alldatabases.sql”:
# mysql -u root -p < mysqldump_alldatabases.sql