Restore a mysql database

From The IT Community
Jump to: navigation, search

It is very easy to restore a MySQL database if you followed the instructions in how to backup a mysql database.

Here is how to restore a MySQL database:

  • Fist log on to the Linux server, the MySQL database is running on.
  • Go to the directory your sql file is in.
  • Execute the following command to restore your MySQL database:
mysql -u [username] -p[password] [database_name] < [database_name].sql

Change [username] and [password] with a user (and his password) that has enough rights to create the database. Change [database_name] with the database you want to restore.

That is it. Depending on the size of your database, this can take some time. After that, all data that could be found in the sql file will be restored.

Was this article helpful? Then please donate to keep The IT Community alive...

If you found this article helpful please share it, comment and help others by writing your own article.

Translate this page: