For mysql: mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql To dump multiple at once, use the databases flag: mysqldump -u root -p[root_password] --databases db1 db2 > combined.sql Then to restore: mysql -u root -p[root_password] [database_name] < dumpfilename.sql