Categories
server

Export database using ssh

When you have a huge database phpmyadmin does not always work properly. One way arround this is to log in by ssh to your server and export the database.

Command to export the database (make sure to replace username and databasename with your database log in username and the correct database name):

mysqldump -u username -p databasename | gzip -9 > exportfilename.sql.gz

If prompted for a password enter the password. Please note that the cursor will remain blinking without any progress update until the export is completed.

The command above will compress the database to reduce disk usage and make it easier to download.

Once the export is completed, you can download the resulting file anytime by FTP. You will find the exported file in the root folder.