This tutorial will show you how to copy or clone an entire database, including all the data, indexes, and keys.
This tutorial assumes that you meet the following conditions:
- You have access to a database, and
- Shell Access to your server.
How to Export A Database
For illustration purposes, I will use the Employees Sample Database provided in the resource below:
To export a database, use the mysqldump tool as:
How to Restore a Database
Restoring a database is as simple as reversing the redirection symbol. For example, to restore the employees’ database from the resource provided above, use the command:
This will import the exported database with output as shown below:
This tutorial has shown you how to use MySQLdump to export databases from one server to another or the same server.