mysql prompt

Discussion in 'Mac Programming' started by ed 07, Feb 21, 2007.

  1. macrumors newbie

    Joined:
    Feb 21, 2007
    #1
    Trying to get mysql prompt on my termial window.
    <computer name>:~ ClareD$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    Password:
    Starting MySQL database server
    So seemed to work ok there - so presume it's downloaded correctly
    Then typed
    <computer name>:~ ClareD$ sudo /ClareD/local/mysql/bin/mysql -u root
    sudo: /ClareD/local/mysql/bin/mysql: command not found
    usr=ClareD is that correct??
    As you may be aware I'm a total beginner, have searched the net, dowloaded tutorials and manual's so any help would be sincerely greatly apreciated.
    i'm working on a macbook version 10.4.8 and have installed mysql standard 5.0.27.
    Cheers
     
  2. macrumors 6502a

    Joined:
    Mar 20, 2005
    Location:
    Diddily Daddily...
    #2
    /usr/ is a directory, it does not actually relate to your username. so you need to run /usr/local/mysql/bin/mysql -u root -p

    without the -p switch you wont be prompted for a password.
     
  3. thread starter macrumors newbie

    Joined:
    Feb 21, 2007
    #3
    mysql prompt

    hey cheers that explains alot but tried entering new command and now getting a different error
    <computer name>:~ ClareD$ sudo /usr/local/mysql/bin/mysql -u root -p
    Password:
    /usr/local/mysql/bin/mysql: /usr/local/mysql/bin/mysql: cannot execute binary file
    clare-duggans-computer:~ ClareD$

    Any ideas??
     
  4. macrumors 6502a

    Joined:
    Mar 20, 2005
    Location:
    Diddily Daddily...
    #4
    um. cant say i've had that before. a quick google came up with a few possibilities:

    1. It's a corrupt file, and needs to be re-downloaded and/or installed
    2. Its built for the wrong architecture (ie, an Intel build, on a PPC mac)
    3. Space monsters have convinced Steven P Jobs that you are not worthy of mysql. lol.
     
  5. thread starter macrumors newbie

    Joined:
    Feb 21, 2007
    #5
    mysql prompt

    hey, downloaded mysql file and installed it again.
    New error message now appearing as below
    <computer name>:~ ClareD$ sudo /usr/local/mysql/bin/mysql -u root -pEnter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

    Could really do with some help if you have any ideas how to get this resolved
    Cheers
     
  6. macrumors member

    Joined:
    Feb 13, 2007
    #6
    it looks like the mysql server may not be running i.e. it's not started listening for connections. Yous should be able to start it by typing sudo /usr/local/mysql/bin/mysqld &
     
  7. macrumors 6502a

    Joined:
    Sep 3, 2005
    Location:
    Cramlington, UK
    #7
    Have you started the mysql server? If not try this:-

    sudo /usr/local/mysql/bin/safe_mysqld
    ctrl-z
    bg

    That should start the server and put it in the background.

    You should then be able to type:-

    /usr/local/mysql/bin/mysql mysql --user=root --password=xxxxxx

    If that doesn't work you'll need to set the mysql root password. Use mysqladmin to do this.

    b e n
     
  8. thread starter macrumors newbie

    Joined:
    Feb 21, 2007
    #8
    mysql prompt

    Hey, cheers for that, I loaded the MySqlStartupItem.pkg and using
    "sudu /usr/local/mysql/bin/mysql -u root" and was able to get mysql prompt. Horray!!
    BUT when entered -p at end of that statement for password below error is occuring

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    Not sure how to set up password??
     
  9. macrumors member

    Joined:
    Feb 13, 2007
    #9
    Try the following Resetting Mysql Permissions
     

Share This Page