MySQL Installation

Discussion in 'Mac Programming' started by dubis07, Jan 18, 2011.

  1. dubis07, Jan 18, 2011
    Last edited by a moderator: Jan 18, 2011

    dubis07 macrumors member

    Joined:
    Aug 8, 2007
    #1
    Hi all -

    I'm really struggling to install MySQL on my Mac (OS X 10.6.6). I feel like I've followed every tutorial possible, but even after installing Mac OS X ver. 10.6 (x86, 32-bit), DMG Archive from http://dev.mysql.com/downloads/mysql/, none of the commands in terminal even acknowledge that it exists (nor can I find it myself).

    I'm pretty sure I got Apache and PHP enabled (I can get the Apache version information), but I'm absolutely stuck when it comes to MySQL. Any recommendations as to what could be going on or where I should go for instructions??

    Thanks!

    If it helps, I'm trying to follow the book Head First PHP and MySQL, but I feel like the install instructions were a little outdated so I turned to online resources.
     
  2. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #2
    Grab MAMP if you are having issues with installing the standard version.
     
  3. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #3
    Add /usr/local/mysql/bin to the path. Done.

    If you don't know how to do that follow these steps.

    Open Terminal.
    Type:
    Code:
    nano .bash_profile
    Type:
    Code:
    PATH="/usr/local/mysql/bin"
    export PATH
    Press Ctrl-O and then hit the Return key
    Press Ctrl-X
    Quit and reopen the Terminal and it should all work.
     
  4. dubis07 thread starter macrumors member

    Joined:
    Aug 8, 2007
    #4
    Hasnr - I've seen that recommendation a few times. I need to look into it to see exactly what MAMP is.

    Cromulent - Thanks and I think we have made some sort of progress. After doing what you said, I went back to the Terminal and typed:

    cd /user/local/mysql

    Then I typed in

    mysql

    And it returned the message: "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"

    I tried restarting, reinstalling, etc. and nothing worked. Any thoughts?
     
  5. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    You don't need to change to /usr/local/mysql/bin for the command to work once it has been added to your PATH it will work anywhere. Also it is usr NOT user.
     
  6. dubis07 thread starter macrumors member

    Joined:
    Aug 8, 2007
    #6
    I cannot tell you how much of a lifesaver you are!

    And sorry - I meant to type 'usr'

    I think I mentioned this before, but I'm very much in the learning phase and I just want to make sure I have Apache, PHP, and MySQL ready to go before I dive into the book. Are you saying that I'm good to go? How could I check if MySQL is installed, as I cannot get it to start up in my preference pane.

    Thank you again!
     
  7. jpyc7 macrumors 6502

    Joined:
    Mar 8, 2009
    Location:
    Denver, CO
    #7
    You may have figured it out, but there are 2 mysql pieces. One is the client (which you tried to do through the Terminal) using the mysql command. That failed possibly because you have not started the mysql server. It sounds like you tried to start it through some GUI (i.e. the preference pane). I'm not at my Mac, but the preference pane might have just set it to start automatically at reboot.

    So, first you need to figure out how to get the server started. Then you can try the client.
     
  8. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #8
    Google -> MAMP . It's at the top. I think it's a much better choice for you since you seem quite lost and really need to learn how to use the terminal first if you want to continue on with the install method you've chosen.
     
  9. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #9
    MAMP = LAMP on a Mac. :p

    LAMP = Linux, Apache, MySQL, PHP.
    MAMP = Mac, Apache, MySQL, PHP.

    http://www.mamp.info/en/index.html

    B
     
  10. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #10
    Coming back to this, in order to get the preference pane working you need to edit a configuration file.

    Open Terminal and type:

    Code:
    sudo nano /usr/local/mysql/support-files/mysql.server
    then look for the line beginning with: basedir=

    and make sure that line and the following line look like this:

    Code:
    basedir=/usr/local/mysql
    datadir=/usr/local/mysql/data
    save and quit with these commands:

    Code:
    Ctrl-o
    Ctrl-x
    now you can just use the preference pane as you always used to be able to without installing any extra crap you didn't need.
     

Share This Page