I have often found putting together command lines a little bit annoying, especially when they contain login details and such. The below has been created as a convenience to generate the required SSH command more efficiently.
Exporting a Database
Exporting a database via phpMyAdmin is always an option to retrieve an SQL dump, but the burden of limited execution times can potentially hinder the integrity of the exported dump. SSH is always the preferred method of retrieving a database.
The below JavaScript app (with the grey background) allows you to enter the required details to generate an SSH command to export a MySQL database. Once you have entered the required details below, it will spit out the required SSH command to enter on PuTTY (or a SSH client of your choosing).
Note – the program does not log any details entered; it is only simple JavaScript. The command will also output the database dump to the “home” directory.
mysqldump -u [USERNAME] -p’[PASSWORD]‘ [DATABASE] > [OUTPUT FILE NAME].sql
What do these inputs mean?
[USERNAME] = the username of the database owner. To access a database, a website requires authorisation to access the database.
[PASSWORD] = the password of the database. The authorisation key to access the database.
[DATABASE] = the name of the database your exporting. There can be multiple databases within one account (for multiple websites perhaps?), therefore this specifies which one to export.
[OUTPUT FILE NAME] = the name of the exported database file. You can name this whatever you want – it will not impact the exporting process.
Note – if you don’t know where to retrieve the above database details, often they will be stored in the “config.php” file of the site. Here is the WordPress one.
