Link to home
Start Free TrialLog in
Avatar of anuneznyc
anuneznycFlag for United States of America

asked on

Running a MySQL script from MySQL Command Prompt on a Mac

I'm a complete newbie to SQL & MySQL. Installed MySQL on my MacBook running OS X 10.6.8. I can launch MySQL from Terminal. I can list the included databases using the "show databases;" command.

I am trying to install the sample files included with a book I'm using to learn MySQL (Ben Forta's MySQL Crash Course).

I would like to execute the two scripts to install the sample databases used as examples in this book. There are two script files, create.sql and populate.sql

I have copied both these files into /usr/local/mysql-5.1.73.osx10.6-x86_64/data folder, which is where I believe mysql stores the local databases.

When I try to run "use create.sql" from the mysql command line, I get an "ERROR 1049 (42000): Unknown database 'create.sql'

Please advise. Thanks in advance.
SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anuneznyc

ASKER

Thank you, @Dave_Baldwin. That allowed me to run the script.
You're welcome, glad to help.