DEV Community

Ali Raza
Ali Raza

Posted on

MYSQL import export using cli

Export Import All Databases

Export:
mysqldump -u USERNAME -p -v --all-databases > alldb.sql

Import:
mysql -u USERNAME -p -v < alldb.sql

Export Import One Database

Export:
mysqldump -u USERNAME -p -v DBNAME> ExportSqlFile.sql

Import:
mysql -u USERNAME -p -v NEWDBNAME < ExportedSqlFile.sql

Note: Add --verbose or -v options to see how the dump is progressing.

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay