How do I backup a MySQL database?

How do I backup a MySQL database?

Backing up your MySQL database can be done couple different ways.



Method #1 Using the phpMyAdmin web interface included in the Hsphere CP

Method #2 Using command line utility "mysqldump"



Using the phpMyAdmin Method:



To access phpMyAdmin, you will need to follow these steps.



1 ) Login to your Hsphere Control Panel



2 ) Under Databases section, You will see MySQL click on this.



3 ) Click on the Database name link you wish to manage through phpMyAdmin



4 ) You will see this hyperlink once you have clicked on database name:
"Built in phpMyAdmin control panel" click on that to launch it.



phpMyAdmin can export your entire database into a .sql file by
selecting the "Export" page found at top of screen, once you have
database selected.



Steps on export screen:



1 ) Select all tables

2 ) Select "Structure and data"

3 ) Select "Add drop table"

4 ) Select "Enclose table and field names with backquotes"

5 ) Select "Save as file"

6) Then click "Go" button



You will be prompted to save the dump file on your computer.



Using the mysqldump command line tool method:



To use MySQL command line dump tool, you would need to either have a
dedicated server, vps server, or cloud server. If you are on a
shared/reseller account, and have access to download MySQL client
package off their website you can do this also as long you are aware of
steps involved.



It's more of an advanced method, but useful to overcome timeout issues
with phpMyAdmin such as if you have really large database.



mysqldump -u mysqluser_here -p -h mysqlserverhostnamehere databasename_here > databasename_here.sql



You will now be prompted for the MySQL user account password which will look like this: "Enter password:"



Note: To find the hostname you can locate that information in the control panel by following these steps.



Hsphere >> Databases >> MySQL >> Hostname will be displayed here.
    • Related Articles

    • MySQL

      MySQL     Log into MySQL: mysql -uUSERNAME -p'PASSWORD' List Users: SELECT User FROM mysql.user; Create & Modify Users: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; Once you have ...
    • How to repair a crashed MySQL table/database

      Symptoms: If your site/application is displaying something similar to: Table './user_dbname/dbprefix_table' is marked as crashed and should be repaired Resolution: 1. Access phpMyAdmin (link can be found in your control panel under Database -> MySQL ...
    • Reset mysql password

      First try to see if you can login to mysql as root. ssh to root user, or su root from AD login.       mysql If you get an error similar to: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Then the password is ...
    • Import Database into Plesk

      How to import a MSSQL database - Windows Shared This process cannot be done via the MSSQL client. Instead, it must be completed inside of the control panel using these steps: Create a blank MSSQL database. Restore the Blank Database With the Database ...
    • How to import/export mysql via SSH commandline

      Managing Databases via Command Line (SSH) Using SSH can be a superior way to manage the files and databases on your account. Using a simple command you can import or export a MySQL database into an existing database on your account.   Please note ...