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
If you enjoyed this post, make sure you subscribe to my RSS feed!