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?, Login into your cPanel Account

Scroll to the Databases section and select the phpMyAdmin tab

How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab

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?, Scroll to the Databases section and select the phpMyAdmin tab 2

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?, Scroll to the Databases section and select the phpMyAdmin tab 3

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?, Scroll to the Databases section and select the phpMyAdmin tab 4

Click on the Go button to start the download process.

How to export MySQL Database?, Scroll to the Databases section and select the phpMyAdmin tab 5

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?, Export MySQL Database using SSH

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. Find the right Web hosting solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

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.