Skip to main content
MySQL backup restore

How to Export and Restore MySQL database

In this tutorial we will explain couple of ways how to export one or all MySQL databases from one server and import to another server. We will also explain how to export MySQL database in a file for backup.
To export database we will using mysqldump command.

In this example we will export one database with name mydatabase. You need to run following command:


If you want to export all databases from one server:

To compress exported database:

If your database use events and routines, to export use following command:

Very useful command if you need to export all databases separately (every database in separate file) except databases information_schema, performance_schema and mysql:

Importing one database to another server:

To import all databases:

That’s it. You now know how to export and import MySQL databases.

SkyHosting

Best Hosting Services: .rs domain registration, Web Hosting, VPS Servers, SSL Certificates. Visit us SkyHosting.

Leave a Reply

Your email address will not be published. Required fields are marked *