fir3net
PPS-Firenetbanner-780.5x190-30-03-17

How do I Export and Import a MySQL Database ?

There are times during migrations, database restores etc that you will need to export and import your MySQL database. Below shows you the commands required to achieved this.

Note : This article is meant as a reference point rather then a full blown article.

Export

mysqldump -u root -p {database} > db.sql

Import

mysql -u root -p -h 127.0.0.1 {database} < db.sql

Tags: Database

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001