How to import and export a mysql database using ssh.

by

Please shareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on RedditDigg thisShare on StumbleUpon

Question :How to import and export a mysql database using ssh.

 

Answer :

     To export a database use:

 

            mysqldump -u root -p db-name > backup.sql 

To import a database:

        mysql -u root -p db-name < backup.sql