mysql prompt

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

  1. macrumors newbie

    Trying to get mysql prompt on my termial window.
    <computer name>:~ ClareD$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    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.
  2. macrumors 6502a

    /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. macrumors newbie

    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
    /usr/local/mysql/bin/mysql: /usr/local/mysql/bin/mysql: cannot execute binary file
    clare-duggans-computer:~ ClareD$

    Any ideas??
  4. macrumors 6502a

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

    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
  6. macrumors member

    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

    Have you started the mysql server? If not try this:-

    sudo /usr/local/mysql/bin/safe_mysqld

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

    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

    Try the following Resetting Mysql Permissions

Share This Page