Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dubis07

macrumors member
Original poster
Aug 8, 2007
33
0
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.
 
Last edited by a moderator:
Grab MAMP if you are having issues with installing the standard version.
 
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.

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

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.
 
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!
 
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.
 
Hasnr - I've seen that recommendation a few times. I need to look into it to see exactly what MAMP is.

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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.