Back up each database into its own gzipped file
backup each mysql database separately | mysql backup per database | export all databases to separate files | mysqldump | mysql | mariadb | backupfor db in $(mysql -NBe 'SHOW DATABASES' | grep -Ev '^(information_schema|performance_schema|sys)$'); do mysqldump --single-transaction --quick "$db" | gzip > "/root/db-backup/$db.sql.gz"; doneQueries the list of all databases, skips the internal system schemas and writes each database to its own .sql.gz file. This makes it possible to restore exactly one database later without digging through a huge combined dump. The target directory must exist beforehand.
Note: On Plesk servers, add -u admin to both calls and set MYSQL_PWD from /etc/psa/.psa.shadow.
Also searched as
- backup each mysql database separately
- mysql backup per database
- export all databases to separate files