Installing MySQL on Mac OS X 10.6 took a bit of digging around. Here is a consolidated tutorial. I am leaving out sudo commands for convenience. Use them where you don’t have permission.
# create the directory where you will keep your MySQL binary distribution mkdir ~/src cd ~/src # download mysql binary distribution from http://dev.mysql.com/downloads/mysql/ # then move the distribution into your src directory mv /path/to/mysql/download.tar.gz ~/src # make sure you are in ~/src (use pwd if unsure) then untar gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - # create the MySQL group dscl . create /Groups/mysql # give it some group id dscl . create /Groups/mysql gid 296 # create a MySQL user dscl . -create /Users/mysql # make the MySQL user a member of the MySQL group dscl . append /Groups/mysql GroupMembership mysql # change ownership to mysql chown -R mysql . chgrp -R mysql . # install mysql scripts/mysql_install_db --user=mysql # make a symlink in the /usr/local directory or you can customize the location in support-files/mysql.server if you prefer mkdir /usr/local cd /usr/local/ ln -s /full/path/to/your/mysql/install/directory mysql # you should now be able to start the server support-files/mysql.server start # add mysql to your PATH # in ~/.bash_profile export PATH=/usr/local/mysql/bin:$PATH source ~/.bash_profile # should bring up the mysql CLI mysql # exit mysql> exit # set mysql server to auto start upon boot mkdir /Library/StartupItems/MySQLCOM cd /Library/StartupItems/MySQLCOM/ ln -s /usr/local/mysql/support-files/mysql.server MySQLCOM # test for success /Library/StartupItems/MySQLCOM/MySQLCOM stop /Library/StartupItems/MySQLCOM/MySQLCOM start # create a root password mysqladmin -u root password your_root_password
No TweetBacks yet. (Be the first to Tweet this post)
If you enjoyed this post, make sure you subscribe to my RSS feed!










27 Comments
Hi Tony thanks for the info.
I actually ran into a problem here:
support-files/mysql.server start
Got the following message
bash: support-files/mysql.server: No such file or directory
Then I tried:
sudo: support-files/mysql.server: command not found
And got this message
sudo: support-files/mysql.server: command not found
I’m using a MacBook Air. 10.6.3. On older machines I installed using binaries and never had a problem but this time it’s a real ball ache.
Any suggestions much appreciated, thanks.
First, thank you, this is helpful.
I ran in to a problem, though… everything worked until I restarted my machine, and noticed that mysql was not running. I tried running it myself
/Library/StartupItems/MySQLCOM/MySQLCOM stop
but got the error
. ERROR! Manager of pid-file quit without updating file.
then I realized I could only start mysql with the sudo command. Not sure why, because I know when I installed mysql I was able to run it with my staff user account.
Either way, I would have though on start up, my mac would execute the startup items with root access. Maybe I’m wrong about this?
thank u so much !! useful information !!!!!!!!
it worked for me on 10.4!
great tutorial!
although I messed up with mysql groups just prior to when I found this article.
when I do ls – l in my mysql folder i see:
-rw-r–r– 1 kato mysql 17987 Sep 7 22:33 COPYING
-rw-r–r– 1 kato mysql 5139 Sep 7 22:33 EXCEPTIONS-CLIENT
so I guess kato is group name, however, I issued a command to add mysql to mysql group…
@Serjio worked on 10.4? Nice. Maybe I should change the title.
If anyone uses this tutorial to install successfully on other OS X versions than 10.6, please leave a comment.
i am beginner mac user. just have bought new macbook. i want to install mysql on it without headache. i tried ur steps but could not install it. please help me out. i got stuck on very first step – mv /path/to/……..
i want more details.
will you please reply me as soon as possible ?
@priya Just move the downloaded tarball to whatever directory you will keep sources. I like ~/src but you can put it wherever you want.
Hey Tony Thank you very much….
I have done it..
thanks for your help.
I have done with installation and now i want to connect ECLIPSE and MySQL,
so will you please help me more in this area?
@priya Sorry that is not my area of expertise. Best of luck!
Hi Tony!
)
Thanx 4 the Tut
I tried to make User and Group by dscl
but it work only for Group… Biz
I cudn’t chown mysql because every time the result -> nobody.
So after create Group mysql with dscl…
best go in System Preferences -> Accounts and make
new user mysql and check on the right Group -> mysql
With that I cud finally chown mysql
Perhaps I missed the point of this article, but why not just download the dmg file, which has the package installer for MySQL and another package installer for the startup item.
Both are on the MySQL download site, and installation is two double-clicks away.
Aloha! celebrex 100mg
how to buy Levlen online 1 viagra dosing for pulmonary arterial hypertension buying InnoPran XL online uk 6 viagra how often cheap sale Dipyridamole 5 caffeine neurons Hytrin saturday delivery 2 does caffeine help release stress KamaSutra LongLast Condoms best buy 4 mobic tab buy Diflucan in china 9 baby motrin buy Cialis Super Active Plus online purchase 5 ivermectin medicine for scabies buy cheap Avapro 6 celexa gad fedex overnight Generic Keflex 6 health benefits of quitting caffeine cheapest Cardura uk cheap 9 zoloft treatment of anxiety
Extreme Thyrocin cash delivery 2 nexium no prescription buy Hoodia Weight Loss Gum cheap 8 kid zantac Entocort next day no prescription 2 time caffeine is in breastmilk Brand Amoxil cod delivery 9 hotel amaryl berlin how to get a Diovan prescription 4 what classifcation of pyridium buy Amaryl us online 6 how is imitrex administered cheap generic overnight Bactrim 6 coke zero caffeine free KamaSutra Intensity Condoms KamaSutra Intensity Condoms 7 viagra quick delivery buy Celebrex next day delivery 9 drug lopressor Acticin overnight 6 basics ramipril
@Scott Davey
I bought a new macbook pro 64 bit. I have been trying to get mysql working using the .tar. Failed. It was until I read your comment on this page, that I realized how easy everything becomes once you use the .dmg on the same page.
I got everything up and running in 5 minutes. Thanks a ton!
The preferences pane icon rocks too!
Dude. Thank you. My local SQL was fazooked for a bit after the upgrade. Your steps worked splendidly. Back to the sandbox!
@Steve:
“I actually ran into a problem here:
support-files/mysql.server start”
At that point, your actually in /usr/local, so you need to add mysql to the front of the command so that it will use the symlink you just created:
I agree with the post above and I will get more information from google
Hey Tony – great article! I couldn’t get the dmg to work so I tried this and it works following your instructions step by step. Thanks so much!
AA
@Tony: this is really a great tutorial, things went like a charm!
Thanks!
@Aaron: I also have the same problem: things won’t start up when my mac is rebooted. Is there any solution to that?
Just to recapitulate, mysql is not started at startup, even though the start script is placed in the /Library/StartupItems library, and mysql can be started using sudo only.
Thanks in advance!
@tony
I was able to go until chgrp -R mysql .
But I have not been able to install mysql using the command “scripts/mysql_install_db –user=mysql” it says file not found.
Moreover, when I restarted Mac, all my original settings are gone and I am logged in as a new user every time (I guess) with no permission to my own folders and the configurations I made in my applications.
Any help to restore my original user setting is highly appreciated!
Thanks,
-Potri
Great tutorial, Tony.
Hi Tony,
Thanks a Ton for this article!!
But unfortunately I am running in to a problem when I try to create mysql group user
# create the MySQL group
dscl . create /Groups/mysql
it throws me the following error:
“Cannot open remote host, error: DSOpenDirServiceErr”
Any help is highly appreciated!!!
bad bad bad
free nude pics of khloe kardashian
naked pictures of selena gomez
selena gomez hotties
these instructions did not work for me.
sudo support-files/mysql.server start
Starting MySQL
… SUCCESS!
export PATH=/usr/local/mysql/bin:$PATH
source ~/.bash_profile
mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)