mysqldump is a very handy utility which can be useful if you work with MySQL databases ,you'll often need to backup your databases and restore them or import them back .
The mysqldump utility produces a set of SQL statements when executed against a database will create the same table structure and table rows or data.
mysqldump is fairly easy to use ,you can use it from the command line with different commands and options to tackle different use cases.
Lets see some practical examples to backup your databases with mysqldump :
Say you have a set of mySql databases ,you can backup them all with one command mysqldump --all-databases --user=root --password > backup-all-databases.sql
This will create backup-all-databases.sql file in your current directory which has a dump for all databases .
All the options are self explanatory --user and --password are for specifying mySql username and password …
[Read more]