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 ?

radu c
  • 4,138
  • 7
  • 30
  • 45
  • duplicate: http://stackoverflow.com/questions/4888604/syncing-remote-database-to-local – Daniel Kutik Mar 10 '11 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. – radu c Mar 10 '11 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. – MatthieuP Mar 11 '11 at 12:50
  • True, I am trying to copy it. I have rephrased my question, thanks correcting me. – radu c Mar 12 '11 at 05:16

1 Answers1

3

Fond a solution:

mysqldump -u my_local_db_username --password=my_local_db_password --host=localhost -C my_local_db_name | ssh user@www.my_domain.com "mysql -u my_remote_db_username --password=my_remote_db_password my_remote_db_name"

source: here

radu c
  • 4,138
  • 7
  • 30
  • 45