1

I need to do a mysqldump of a single table from one server to another.

If I dump the entire db all goes well:

 mysqldump {database_name} | mysql -h {host_name} -u {user_name} -p{password} {database_name}

But if I try to dump a single table like this:

mysqldump {database_name} {table} | mysql -h {host_name} -u {user_name} -p{password} {database_name} {table}

I get: "mysqldump: Got errno 32 on write".

Does anybody have an idea what is causing this?

Thanks

user3605780
  • 6,542
  • 13
  • 42
  • 67
  • possible duplicate of [How to backup a single table in a MySQL Database?](http://stackoverflow.com/questions/6682916/how-to-backup-a-single-table-in-a-mysql-database) – Sadikhasan Jan 31 '15 at 10:39

1 Answers1

1

Error 32 is "broken pipe". It means that the reading process exited before reading everything that was written to the pipe.

The problem is that you're giving incorrect arguments to the mysql command. It shouldn't have a table name at the end of it. It just executes the commands that are in the dump file that was piped to it. When you put the table name in the mysqldump command, the dump file will just contain that one table.

Barmar
  • 741,623
  • 53
  • 500
  • 612