How can we take a backup of multiple databases by using mysqldump client program?

By using mysql dump client program we can take the backup of multiple databases into a file having the extension ‘.sql’. It can be understood with the help of the following example −


In this example, with the help of mysql dump client program, we are taking the backup of two databases named ‘tutorials’ and ‘query1’ in a file named ‘tutorials_query1.sql’. The following command will do this −

C:\mysql\bin>mysqldump -u root --databases tutorials query1 > tutorials_query1.sql

The above command will create a file named tutorials_query1.sql which have the dump information of both the databases named tutorials and query1.