How to restore your MySQL database?

This article applies to Rackbank Dedicated Servers running Plesk-
To get started with restoring your MySQL database, you need to execute it from the command line and proceed as follows:

1. At First, you have to create a new database on server to which you’re migrating your data. It can be done in Plesk. You need to login into Plesk and click ‘Domains’. Then, you have to click on ‘Databases’ and create a database having same name as that of database being restored.

2. After creation of database, you have to go back to the command line and run the command given below:

[root@hostname]#mysql -u admin -p`cat /etc/psa/.psa.shadow`
[databasename] < [path of backup]

3. If the database is stored in the name ‘psa’, it results from the above command saving the file in /root/psa.sql.
[root@hostname]#mysql -u admin -p`cat /etc/psa/.psa.shadow` psa < /root/psa.sql

And by following above steps, you can easily restore your database.

Radhe

Radhe Dhakad is Support Executive and Network Admin at RackBank Datacenters Pvt. Ltd.. He is our curious techie who loves experimenting on servers and likes to pen down whatever he explores new on server technology!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Copyright 2013-2021 RackBank© Datacenters Pvt. Ltd.


Data Center in India

Rated 4.7/5 based on 31 reviews at Google+