how to mysqldump remote db from local machine
Posted
by Mauritz Hansen
on Stack Overflow
See other posts from Stack Overflow
or by Mauritz Hansen
Published on 2010-06-07T13:06:46Z
Indexed on
2010/06/08
5:02 UTC
Read the original article
Hit count: 274
Hi folks,
I need to do a mysqldump of a database on a remote server, but the server does not have mysqldump installed. I would like to use the mysqldump on my machine to connect to the remote database and do the dump on my machine.
I have tried to create an ssh tunnel and then do the dump, but this does not seem to work. I tried:
ssh -f -L3310:remote.server:3306 [email protected] -N
The tunnel is created with success. If I do
telnet localhost 3310
I get some blurb which shows the correct server mysql version. However, doing the following seems to try to connect locally
mysqldump -P 3310 -h localhost -u mysql_user -p database_name table_name
Can someone assist me?
Thanks,
Mauritz
© Stack Overflow or respective owner