Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With this command :

mysqldump -uuser -ppass dbname > 1.sql

You can dump dbname to 1.sql

I want a way to dump and restore just 1 table of dbname from ssh and command line

share|improve this question

You can just add a tablename to your command

mysqldump -uuser -ppass dbname tablename >1.sql

To recover

mysql -uuser -ppass -e "create database dbname;"

mysql -uuser -ppass dbname <1.sql

You may want to look at the mysqldump and mysql man pages for further information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.