Knowledgebase: MySQL
Export a MySQL Database
Posted by ASO Admin on 21 February 2020 12:12 PM

Export a Database via cPanel

To export a MySQL database via cPanel:

  1. Log into cPanel

  2. Click phpMyAdmin from the Databases section 

  3. From the left-hand sidebar, click the name of the database you want to export

  4. Click the Export tab/button up near the top 

  5. Choose your export method and your format from the available dropdowns 

  6. Click the Go button

  7. Choose where to save your export, and what to name it in the pop-up 

Export a Database via Command Line

mysqldump -u DBUSER -pDBPASS DBNAME > dump.sql

Replace the text in the uppercase letters with the appropriate information:

  • DBUSER - Database user with privileges to the database

  • DBPASS - Password for the database user

  • DBNAME - Database name

If your password contains special characters like (* ? [ < > & ; ! | $), you will either need to escape them with a backslash, put the password between single quotes, or leave the password out (you'll be prompted to enter a password).

Here are some examples:

Escaped Password

mysqldump -u DBUSER -pM\*Y\?P\[A\<S\>S\&W\;O\!R\|D\$ DBNAME > dump.sql

Password In Quotes

mysqldump -u DBUSER -p'M*Y?P[A<S>S&W;O!R|D$' DBNAME > dump.sql

No Password

mysqldump -u DBUSER -p DBNAME > dump.sql

Also, if you're trying to export a database that's located on a different server, you'll need to set the database server hostname (by default the hostname is localhost or 127.0.0.1):

mysqldump -h DBHOST -u DBUSER -p DBNAME > dump.sql



Attachments 
 
 phpmyadmin (1).png (64.12 KB)
 exporttab.png (152.10 KB)
 exportgo.png (74.87 KB)
 screen_shot_2015-04-03_at_11.07.45_am.png (64.49 KB)
(0 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk Software by Kayako fusion
ERROR: This domain name (kb.asmallorange.com), does not match the domain name in the license key file help.asmallorange.com.

For assistance with your license, please contact the Kayako support team: https://support.kayako.com