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.
This should do the trick:
\. filename
(provided within MySQL's command line, assuming filename is SQL file)
CREATE DATABASE IF NOT EXISTSPlace the password immediately after -p
mysql -u root -ppassword database < file.sql
mysql -u root -p database < file.sql will ask your password in a safer way. And if somebody see you typing your Twitter password they would see ***********. Just a little peek on -pMyMySQLPassword would be needed to know your password. And excuse me if this comments sounds rude ;)