Create A Bash Function To Copy MySQL Or PostgreSQL Database To Another Database Locally And Remotely

Posted By Weston Ganger

I have multiple development machines and I usually have one database that has way more data in it. Heres how to copy it to another database locally and remotely.

Firstly the database must be created or exist on the destination server. Then run one of these commands from the destination computer.

For MySQL:

update-mysql-db my_database myuser@192.168.1.7

update-postgresql-db my_database myuser@192.168.1.7

Article Topic:Software Development - Linux

Date:August 16, 2016