Skip to main content

Manually Exporting Your MySQL database

Level: Intermediate


In this guide, we will demonstrate step-by-step instructions on manually exporting your MYSQL database.

Exporting your MYSQL database

Databases makes managing and accessing your data easier, especially if you have multiple items needing to access it. However you may find yourself needing to export the data to keep as a backup or move databases. This guide will cover how.

Windows

Step 1: Downloading a Database management software

HeidiSQL is a well known and simple Graphical MySQL database management tool. However, you should always do your research in what software you install. ⁣

  • Visit the HeidiSQL download page and download the installer.

  • Once you have located the downloaded file, you will need to run it, select the file and install the software.

  • Make sure to have HeidiSQL open.

Step 2: Grabbing the details to your Database

  • Head to your server Dashboard and head over to the Database tab to make note of your credentials.
  • You will want to keep a note of the details such as IP address, username, password and database name.

US_mysql_client_database_tab.png

US_mysql_client_database_details.png

Step 3: Exporting your database

  • First, we need to get HeidiSQL logged in so it can manage and export your database.
  1. Click on the New button so we can add the session.
  2. Input the IP address of where your database is hosted.
  3. Enter your username and password credentials (refer to last step).
  4. Input the name of the Database you wish to connect to.

US_Mysql_export_heidi.png

  • Once connected, you will see a lot of information regarding your database. You will want to right-click on the database and hit export database as SQL.
  1. You may choose between insert or insert and replace existing data. Either way, MySQL will continue.
  2. You may decide how you want your data to be stored. Either a singular database file or just in a zipped SQL folder.
  3. Make sure the file is saved where you want it to be.
  • In your folder, you will see the file from the MySQL backup.

US_MySQL_heidi_export_option.png

US_mysql_heidi_export_sql.png

Linux (Ubuntu/Debian)

Please keep in mind, you may require sudo privileges. If you do not know what a command does, then please do research. For example, you should understand installing packages, navigating folder structures, etc.

Step 1: Installing the client

  • Open your terminal.
  • Execute sudo apt update -y and sudo apt install mariadb-client -y which shall install the latest version of a MySQL client.
  • Execute mysql --version to verify it has been installed.
    • If you receive a message command not found, then try typing bash and run the command again.

Step 2: Grabbing the details to your Database

  • Head to your server Dashboard and head over to the Database tab to make note of your credentials.
  • You will want to keep a note of the details such as IP address, username, password and database name.

US_mysql_client_database_tab.png

US_mysql_client_database_details.png

Step 3: Exporting your database

  • Open your terminal.
  • Choose a spot to download your backup. Let's say you want it to do it in your home directory, so you use cd ~.
  • Execute the following command:
    • Make sure to replace USERNAME, PASSWORD and DATABASE_NAME with the details from the previous step.
mysqldump -h DB_IP -u USERNAME -pQ'PASSWORD' DATABASE_NAME > backup.sql
  • Unfortunately, mysqldump does not have a way to view the progress of the dump, so you need to wait for it to finish.

If you are having trouble with this, you can open a support ticket here!
Feedback and suggestions regarding this article are welcome in our Discord server.