Exporting a database over SSH

In case exporting a database through phpMyAdmin didn't work you can export your database using SSH. Here are the steps:

 

Step 1 - Preparation

First, you would need to gather your database’s parameters, including the password. If you are not confident in the exact value of your database password - change it.

 

Step 2 - Connecting

  • Open your root directory (public_html)

Step 3 - Export

Use this command to export the database:

mysqldump -u database_username -p database_name > file.sql

If the parameters of your database are:

  • MySQL Database name: u123456789_database

  • MySQL Username: u123456789_admin

  • Exported database backup name: backup.sql

The command will look like this:

mysqldump -u u123456789_admin -p u123456789_database > backup.sql

After that you will need to enter the database password - the exporting process will start. When it is completed, a new line will appear:

-bash-4.2$

Keep in mind that the export will take some time depending on the size of your database

 

That’s it! Now you know how to export your MySQL database

 

Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)