Philip Kirkbride
Philip Kirkbride

Reputation: 22879

Update online MySQL with local computer SQL via Command Prompt?

I have an online sql database which is used by a PHP web-script.

I'm working with someone who is managing a local database on their computer.

I need a way to replace the content of my online sql database with the updated version from the computer, preferably using Windows Command Line. How can I do this?

Upvotes: 0

Views: 273

Answers (1)

Dan Armstrong
Dan Armstrong

Reputation: 2086

You could use the mysql utilities to do this. mysqldump will create a backup of the updated database and then you can feed that into your online database using the mysql utility.

C:>mysqldump -uUSER -pPASSWORD DATABASE > database.sql
C:>mysql -hHOST -pPORT -uUSER -pPASSWORD DATABASE < database.sql

Upvotes: 2

Related Questions