Knowledgebase
Knowledgebase
How to backup, access and restore MYSQL database?
Posted by Sinan Esen on 21 April 2015 03:31 PM

This only applies to Linux Web Hosting.
For Windows and MSSQL click here

This article is ideal for people moving websites that have a database containing data. You will find this most helpful if you are using a CMS (Content Management Suite) such as Joomla, Wordpress and Drupal . You will also find this helpful if your website contains a forum.

 

 

Documentation Plan
Learn to use MySQL
Acces PHPMyAdmin from your Control Panel
Backup databases with PHPMyAdmin
Backup databases via command line (advanced users)
Restore databases with PHPMyAdmin

 

 

 


 

If you want to learn how to use MySQL, you can follow these different courses:

 

 

 

 


 

Please follow these steps to acces PHPMyAdmin from your Control Panel:

 

1. Log in to your Openhost Control Panel

 

2. Choose your hosting plan from the Subscription drop-down box (top-right)

 

3. Click on the Databases button in the tool box

 

4. If you do not have created a database yet:

  • Click on the Add New Database button in the tool bar

  • Fill out the database information as follow then click OK

 

5. To access PHPMyAdmin, click on the Webadmin button. (This should open PHPMyAdmin in a pop up window. If it does not, then you will need to disable any pop up blocker that you may have in your browser)

 

 

 


 

Please follow these steps to backup databases once in PHPMyAdmin:

 

NB: To learn how to manage PHPMyAdmin from your old plesk, please follow this video tutorial.

 

1. Click on the Databases button to get a list of the databases in a drop down box, then click the database name you wish to back up in the left-hand pane of the page

 

2. Click the Export tab in the navigation links toward the top of the page

 

3. Select the Custom - display all possible options option under the Export Method heading

 

4. Scroll down to the Object creation options heading and enable the Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement option

 

5. Scroll to the bottom of the page and click the Go button

 

 

 

 


 

NB: There is an other way to backup databases for advanced users using the mysqldump command tool:

 

  • The syntax to dump an entire database is:

 

mysqldump -u username -p --database mydatabase > mydatabase.sql 

(enter password when prompted)

  •  You can also choose to dump only certain tables:

 

mysqldump -u username -p mydatabase mytable1 mytable2 > mydatabase.sql

(enter password when prompted) 

 

The mysqldump command prints out all the SQL commands necessary to reload your database (or specified tables), which in the examples above is redirected to the file mydatabase.sql. The mysqldump tool is a standard part of the MySQL distribution, and it uses the same options format as the other tools. The documentation is contained in the MySQL manual. mysqldump --help provides a quick option list.

 

 

 


 

Please follow these steps to restore your databases in PHPMyAdmin:

 

1. Click the Import tab in the navigation links toward the top of the page

 

2. Click the Choose File button under the File to Import: heading 

 

3. Locate and select your backed up SQL file

 

4. Click the Go button at the bottom of the page

 

(3 vote(s))
Helpful
Not helpful