Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. 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

I would like to copy a MySQL database form Linux to Windows, from a little research I found this url where the author says we could copy MySQL Database using the following command in Linux

Linux to Linux

mysqldump -u username -p 'password' db-name | ssh mysql -u username -p 'password' db-name

Is there a command for copying MySQL database from Linux to Windows?

share|improve this question

migrated from Mar 5 '13 at 3:12

This question came from our site for professional and enthusiast programmers.

Do you mean on the same machine? – Roney Michael Mar 4 '13 at 18:07
dump db on one server, import dump on other server: – Marc B Mar 4 '13 at 18:08
It means from a remote server via ssh can do it in any of the pc with an ssh-console enabled – Robert Rozas Mar 4 '13 at 18:08
@RoneyMichael from a Linux Machine to a Windows Machine – peplamb Mar 4 '13 at 18:32
@MarcB thanks you, I do know this but is there a single command to do this from Linux to Windows just like from Linux Machine to an other Remote Linux Machine? – peplamb Mar 4 '13 at 18:34

Linux -> Windows you have two obvious options.

  1. Setup a SSHD on your Windows machine and use the above command (mysql binary would need to be in your search path under Windows).

  2. Configure your root (or similar privileged account) to access your Windows MySQL host over network then do:

mysqldump -u username -p 'password' db-name | mysql -h windowsip -u username -p 'password' db-name

Unfortunately with #2, if you have complex indicies (or huge tables) you'll have issues with net_read_timeout on your Linux host. For most situations I would expect this to just work, though.

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.