Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.