Summary: We have acquired a large databse dump which we need to import into our local system. Since the database size is large, phpmyadmin can’t help. MySQL command line tool comes to our rescue 🙂
Change directory to where our SQL script is:
1 |
cd ~/Downloads |
First login to mysql:
1 |
mysql -u root -ppassword |
Change database to our target database:
1 |
use somedb; |
Execute the SQL Script:
1 |
source somedb_backup.sql |
One reply on “Import SQL Script to MySQL using the Command Line”
mysql -uusername -ppassword dbname < script.sql