How to export MySQL Database?

Exporting a MySQL is vital for easy backup of important files and information within the database. When you export a database, you can import it into another database server to access the queried data.

Exporting a MySQL database from your account can be done in two ways:

  1. Via phpMyAdmin Tool
  2. Via SSH

In this article, we are going to discuss the step-by-step process of both methods. 

Ready? Let’s get to it!

Export MySQL Database using phpMyAdmin Tool

PhpMyAdmin tool is a MySQL application that helps to carry out several database management activities. With phpMyAdmin, you can:

  • Create
  • Drop
  • Delete
  • Import
  • export MySQL database tables.

In this section, we are going to show you how to export databases using the phpMyAdmin tool. You can use this method when dealing with smaller-sized files or files that are less than 128MB.

To export MySQL Database using phpMyAdmin Tool, follow these steps:

Login into your cPanel Account

How to export MySQL Database?

Scroll to the Databases section and select the phpMyAdmin tab

How to export MySQL Database?

In the phpMyAdmin area, the tool will display a list of all the existing databases. Select the database you wish to export.

How to export MySQL Database?

When the database is open, it will display a set of options on the screen’s upper part. Select the Export option.

How to export MySQL Database?

Select your preferred export method. If you are unsure about what option to select, leave it at the default option chosen

How to export MySQL Database?

Click on the Go button to start the download process.

How to export MySQL Database?

This process will export your database file to your local computer successfully.

Export MySQL Database using SSH

SSH stands for Secure Shell. It’s a network protocol that established a secure connection between a client and a server. You can use it to connect to your database and export the data from it to an SQL file saved on your server. However, you need to bear in mind that SSH is only available via the Command-Line Interface, so you need to be a bit more comfortable working with commands.

After logging into the server via SSH successfully, you need to execute a command that looks like this:

$ mysqldump -p -u [your_user] [your_database] > [filename].sql

So, if you have a MySQL user called test_user that has access to a database called test_wp908040 and you want to export the data to export.sql, the command will look like this:

How to export MySQL Database?

After you enter the password, MySQL will export the entire database and will save it to export.sql. If you want to retrieve the file, you can do it via FTP.

You can also use SSH to export a MySQL Database when working with files that are larger than 128MB.

Was this helpful?

What’s your goal today?

1. Sign up to our newsletter and keep up to date with the latest news. Our team consist of highly skilled ex-sysadmins and hosting veterans, ready to share their unique hosting-related knowledge with you.

Sign up for ScalaHosting monthly News Letter and we will keep you up to date about the most valuable pieces of content we publish on our blog

2. Explore our VPS Hosting - with our 30-day unconditional money-back guarantee and free, effortless migration, you can try our award-winning Managed Cloud VPS solutions risk-free.

Rado
Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.

Write a Comment

Required*

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.