Import and Export MySQL databases

Database Export

#!/bin/bash
mysqldump -u [username] -p [database name] > [database name].sql

 

Database Import

#!/bin/bash
mysql -u [username] -p newdatabase < [database name].sql

 

Top