The following is a quick and easy way to export and import a mysql database.
Keep in mind if at the new location the database doesn’t exist you will need to create it first.
Export:
mysqldump -u USER -p DATABASE > backup.sql
Import:
mysql -u USER -p DATABASE < backup.sql