How you can backup mysql and restore mysql dump .sql file on linux OS via command line?
You need to know your mysql password.

Backup table named "tablename" from database "databasename" for user "root" and mysql password "Mysqlrootpassword"

mysqldump -u root -pMysqlrootpassword databasename tablename > tablename.sql

If you wish to backup whole database, just dont add any "tablename"

Restore mysql dump file back into mysql database

mysql -u root -p databasename < tablename.sql