Thursday, September 17, 2009

DB Dumps

MySql Dump

mysqldump --protocol tcp -P portnumber -h localhost -u root databasename > filename.sql

DB dump of all database

shell> mysqldump --all-databases > all_databases.sql

Postgresql dump

To get the database dump execute the below commands from outside the database

1. /usr/bin/pg_dump -U postgres -f - only for structure;
2. /usr/bin/pg_dump -U -d > - data + structure;

3.pg_dump dbname -U username -h hostname -p > filename.sql

4.pg_dumpall -U username -h hostname -p > filename.sql

No comments:

Post a Comment