Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Baseball

  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Baseball

    Hey guys,

    I'm new at SQL and feel hopeless right now with it.

    I recently got a book about baseball statistics...and it talks about downloading a database for MYSQL. After decompressing the file he says I should do this......


    1 ~ % mysql -p -u root
    2 Enter password:
    3 Welcome to the MySQL monitor. Commands end with ; or \g.
    4 Your MySQL connection id is 22 to server version: 4.0.21-standard
    5
    6 Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    7
    8 mysql> GRANT ALL ON bbdatabank.* TO 'root'@'localhost' IDENTIFIED BY 'P@ssw0rd';
    9 Query OK, 0 rows affected (0.07 sec)
    10
    11 mysql> CREATE DATABASE bbdatabank;
    12 Query OK, 1 row affected (0.00 sec)
    13
    14 mysql> quit
    15 Bye


    That seems to work ok...but the next step is where I get stuck.

    The file I unzipped was called BDB-sql-2005-08-02.sql. You can import this in a single step using this command (you will need to use the same username and password you used in the previous step):

    ~ % mysql–u jadler -p -s bbdatabank < BDB-sql-2005-08-02.sql
    Enter password:P@ssw0rd



    The < sign means "read the filename to the right and send it to the program to the left."

    I never get the Enter Password part...all I get is this
    ->

    Any help would be greatly appreciated...I've been trying to figure this out the last 3 days.

    THANKS!

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Do you have a space between mysql-u when you type it for real? (you should have...)

    and you are entering this from the bash/dos/whatever command-line, rather than after you've entered mysql?

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Before going any further I'd suggest you upgrade to mysql 4.1 at a minimum, it supports subqueries and group_concat among other items that will most likely be useful. the current version of mysql is 5.0.22 and it supports even more items not available in 4. if you are not worried about having the same version as on a hosted machine then I'd say upgrade to mysql 5.

  • #4
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey guys,

    Thanks for getting back to me so quickly. A few things that may help you help me figure this out.

    -I am using MYSQL 5

    -When MYSQL starts the very first thing it asks for is a password. How do I get it into the "dos" menu you were talking about, so I can input the code I am having trouble with.

    Thanks for all the help!

  • #5
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    if you're running windows, then you get the command-line (it's not actually dos in 2k/xp, just in case any pedants turn up...) by clicking 'start', then 'run' then typing 'cmd' and pressing enter.
    this is where you run the import from
    (on linux, you'll either be logged in on a command-line, or you can start a terminal from one of the menus).

  • #6
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Quote Originally Posted by marlins998
    -I am using MYSQL 5
    Well this line above:
    Your MySQL connection id is 22 to server version: 4.0.21-standard

    seems to suggest otherwise.

  • #7
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    I read it like that at first as well, but re-reading, I think that the bits of terminal output are copied from the guide he is following.

  • #8
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey guys,

    First I upgraded my mysql..thanks

    I tried punching it in the command line...and it says "the file specified does not exist". Could I be doing my username wrong? It says my username is "root"

    Any other tips? Thanks for the help so far!

  • #9
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    it means exactly what it says, the file you're trying to import isn't where you're telling mysql to look.
    YOu either need to use 'cd' to change directory to the location of the file, e.g.
    cd C:/Documents & Settings/Administrator/Desktop
    (or wherever)
    or provide a full file-path to myqsl
    mysql --user=root --password --database=database < C:/Documents & Settings/Administrator/Desktop/file.sql


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •