1

I have a local MySQL databases and I want to deploy it on the remote server.

There is some tool in PhpMyAdmin to synchronize local and remote databases, however is very slow if you have large databases, as in my case.

Is there a better and a faster way ? Such as shell through ssh, or something else ?

4
  • duplicate: stackoverflow.com/questions/4888604/… Commented Mar 10, 2011 at 11:51
  • this is how to get the remote db to your localhost PC, but I need to put my local db to the remote server. Commented Mar 10, 2011 at 12:33
  • You should rephrase your question. You are not trying to synchronize your DBs, you are trying to copy and deploy a snapshot. For synchronization, look to mysql replication. Commented Mar 11, 2011 at 12:50
  • True, I am trying to copy it. I have rephrased my question, thanks correcting me. Commented Mar 12, 2011 at 5:16

1 Answer 1

3

Fond a solution:

mysqldump -u my_local_db_username --password=my_local_db_password --host=localhost -C my_local_db_name | ssh [email protected]_domain.com "mysql -u my_remote_db_username --password=my_remote_db_password my_remote_db_name"

source: here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.