Import a mysql database from terminal

mysql -u username -ppassword databasename < filename.sql

Username: daniel
Password: 123Headadmin
Database name: my_new_db
Database file name: my_old_db.sql

mysql -u daniel -p123Headadmin my_new_db < my_old_db.sql

Leave a Reply

Your email address will not be published. Required fields are marked *

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