This is a discussion on MySQL Newbie Question within the MySQL Database forums, part of the Database Forums category; Apologies in advance, this is my first time using MySQL. I bought a book called Baseball Hacks which promises to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Apologies in advance, this is my first time using MySQL.
I bought a book called Baseball Hacks which promises to help me use programs like MySQL to analyze baseball data.. I have installed MySQL and downloaded a .SQL file of historical statistics, but I'm having trouble importing that database into MySQL. The book says to grant myself permission to access it (no problem) then create the database (no problem). THEN it says to import the database with the following code: ~ % mysql -u username -p -s bbdatabank < BDB-sql-2006-11-17.sql When I type this at the mysql> prompt, I'm getting a syntax error, but I don't know where else to type it in the command line interface. Also, would the location where I saved the BDB-SQL-2006-11-17.sql file matter? For simplicity, I saved it to the C:\ root but adding C:\ before the filename doesn't seem to help. Sorry for asking what I'm sure is such a simple question, but I'm a baseball fan first and a database expert not at all, so any help would be appreciated. |
|
|||
|
On Jan 27, 4:24 pm, "blakeformayor" <blakeforma...@gmail.com> wrote: > Apologies in advance, this is my first time using MySQL. > > I bought a book called Baseball Hacks which promises to help me use > programs like MySQL to analyze baseball data.. > > I have installed MySQL and downloaded a .SQL file of historical > statistics, but I'm having trouble importing that database into MySQL. > > The book says to grant myself permission to access it (no problem) > then create the database (no problem). THEN it says to import the > database with the following code: > > ~ % mysql -u username -p -s bbdatabank < BDB-sql-2006-11-17.sql > > When I type this at the mysql> prompt, I'm getting a syntax error, but > I don't know where else to type it in the command line interface. > > Also, would the location where I saved the BDB-SQL-2006-11-17.sql file > matter? For simplicity, I saved it to the C:\ root but adding C:\ > before the filename doesn't seem to help. > > Sorry for asking what I'm sure is such a simple question, but I'm a > baseball fan first and a database expert not at all, so any help would > be appreciated. Just to make this really easy... Put the sql file in to your mysql/bin folder. On my machine it's located at C:\Program Files\somefolder\mysql\bin Then, at the C:\> command prompt navigate to this directory: C:\>cd "Program Files\somefolder\mysql\bin"\ Then, at the 'C:\Program Files\somefolder\mysql\bin>' prompt, type this: mysql -u root -p -s bbdatabank < BDB-sql-2006-11-17.sql Then, when prompted, enter your password and it should all work hunkydory. Also, re-read the beginning of the book. They may mention something about the conventions used in the book. |