Trying to Export MySQL database is really hard if you are not used to export from the terminal. However, if you are using a command line like vagrant or some other tools, you have to deal with the terminal and you will now know that terminal is the fastest and easiest way to parse data and backup or restore data.
Mysql is one of the most widely-used relational database in the world. It is set as default in CPanel Hosting and so on. There are two types of application or server: mysql and mariadb. They both have the same style and language, but different in processing.
If you want to export mysql via ssh, you must have the followings:
To export the database, try to connect to your server with the following command:
>> $ ssh username@host
When you are logged in, the following information will be shown:
>> username@host /path/to/your/home:
Exporting command is easy
>> $ mysqldump -u %username% -p %databasename% > %backupfilename%.sql
Let me explain in detail.
For example, I have to connect to customer database with username root and password pass. I have to dump the database. I would like to set the file name to customer_backup.sql then:
>> $mysqldump -u root -p customer > customer_backup.sql
>> password: **** (test)
>> $ ls
>> rwx------ customer_backup.sql
That's it. Really easy!
If you cannot export then, there is something wrong with your syntax. Try again properly.