It is possible to back up and restore MySQL DBs via the server command line. We are usually using the 'mysqldump' command to take the backup of a database from the command line interface. You can watch the video tutorial by clicking here.
Backup a DB:
# mysqldump db_name > db_name.sql
Or by specifying the username and password
# mysqldump -u user -p db_name > db_name.sql
Restore a DB:
# mysql db_name < db_name.sql
You need to provide the DB name to be restored in the first place and then after the '<' symbol, provide the backup file name or the full path.