I am trying to import a 60 MB file, filename-20120201.tbz, into a newly created MySQL database. I am using terminal, and have opened the database by the prompt use new_database.
How do I import this file correctly? I am on a Mac. Thanks.
To run SQL files from the terminal, you can use the source or the backslash and dot command ( \. ) Next, enter the password for your root user. The path /Users/nsebhastian/Desktop/test/main. sql above needs to be changed to the SQL file path on your computer.
If you are running mysql and using your newly created database use the below code to run the script file
mysql> SOURCE input_file
or from terminal
mysql -u root -p database < filename-20120201.tbz
Try
$ mysql -u root -p new_database < db-dump.sql
Where: new_database is the name of your new database and db-dump.sql is the mysql file to be imported
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With