Thursday, 5 May 2011

How to export mysql data from remote to local server

You are only given port 3306 on the remote server. You can't do things like ssh to manage your mysql. So here is the simple receipe:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where='usrstatus =1;' > test.sql

i used this command on linux but in windows you may try like this instead:

mysqldump -u user -pmypassword -h 192.168.1.111 mydatabase mytable --where="usrstatus =1;" > test.sql

notice the double quote in windows & please put your password beside -p & no space & you can use --where to tell what is your condition of table you want. please try to modify it according to your need.

No comments:

Post a Comment