Skip to content

Instantly share code, notes, and snippets.

@ozh
Created August 31, 2025 19:27
Show Gist options
  • Save ozh/73eeaa5657366af574940ac4909d200f to your computer and use it in GitHub Desktop.
Save ozh/73eeaa5657366af574940ac4909d200f to your computer and use it in GitHub Desktop.
Export all your databases, one by one

Export all databases except #mysql50#mysql-8.4, information_schema, mysql, performance_schema and phpmyadmin :

 for DB in $(mysql -u root -e "SHOW DATABASES;" | grep -Ev "mysql|phpmy|schema|Database"); do echo "DB : $DB"; mysqldump -u root --skip-lock-tables --databases $DB > db_${DB}.sql; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment