Import & Export Database to & from MySQL using CLI

Here is how you can import database to MySQL from Terminal:

mysql -u <username> -p <databasename> < <filename.sql>

Use this script to export MySQL database from terminal:

mysqldump -u [username] -p [database name] > [database name].sql

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: