Mysql

#backup

mysqldump -u root -p1234 -h remotehost database > backup.sql

#restore

mysql -u root -p4321 -h localhost database < backup.sql

PostgreSQL

#backup

sudo -u postgres pg_dump database > dump.sql

#restore

sudo -u postgres psql -d database -f dump.sql

Advertisements