Mysql – terminal command for thesql file import

mysql

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.

Best Solution

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