How to export a database with mysqldump utility on CLI

If you have a large database, you may want to export your MySQL database using the CLI or command line, using the mysqldump utility. Login to your account and access the terminal. If you need terminal access, you will need to upgrade to a plan with terminal access.

In your home directory, run the following:

mysqldump -u USER -p DATABASE > database_dump_name.sql

Replace USER with the username that can access the database. Replace DATABASE with the database name. The SQL file can be named what you would like. mysqldump should be fairly quick, even on large databases.

Once exported, you can zip it and move it.