Bluehost.com Web Hosting $6.95

MySQL Newbie Question

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-27-2007
blakeformayor
 
Posts: n/a
Default MySQL Newbie Question

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.

Reply With Quote
  #2 (permalink)  
Old 01-27-2007
strawberry
 
Posts: n/a
Default Re: MySQL Newbie Question



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.



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0