2. The script asks for the corresponding MySQL password for security reasons (the password is not echoed or saved anywhere – as you would expect on a Unix systems)
3. The output dir can also be specified from the command line
4. Support for gzipped output files (optional)
UsageDownload the dump-all-databases.sh. Make it executable using chmod +x dump-all-databases.sh.
./dump-all-databases.sh -u user -o my_backup_dir -zThe command line options are the following:
- -u – the MySQL user
- -o – output dir (optional, if not specified the dump files will be placed in current directory)
- -z – enables the gzipped output (optional)
System requirementsUnix/Linux system with mysql and mysqldump installed, for gzipped output gzip is also required.