Installing MySQL 5.1 on OS X 10.7 Lion

Posted by xisal on Super User See other posts from Super User or by xisal
Published on 2011-09-06T22:19:18Z Indexed on 2012/03/28 23:35 UTC
Read the original article Hit count: 490

Filed under:
|

I am trying to install MySQL 5.1. I am on Lion, and when I remove all files associated with MySQL on my machine it still tells me that I have a newer version installed when I try to install it from the DMG file.

Has anyone successfully installed MySQL 5.1 on Lion?

I found a solution using Homebrew:

  1. Completely remove MySQL from your system (just in case)
    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    vim /etc/hostconfig and removed the line MYSQLCOM=-YES-
    rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /var/db/receipts/com.mysql.*
    
    Source:http://stackoverflow.com/questions/1436425/how-do-you-uninstall-mysql-from-mac-os-x
  2. Install homebrew
    /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
    
    Source: https://github.com/mxcl/homebrew/wiki/installation
  3. Install MySQL 5.1 via brew
    brew install mysql51
    if that doesn't work, do this:
    brew install https://raw.github.com/adamv/homebrew-alt/master/versions/mysql51.rb
    Source: http://stackoverflow.com/questions/4359131/brew-install-mysql-on-mac-os/6399627#6399627
  4. Make MySQL Work
    1. Create mysql.sock file
      touch /tmp/mysql.sock
    2. Install MySQL default tables
      /usr/local/Cellar/mysql51/5.1.58/bin/mysql_install_db
      ...or your path
    Source: http://stackoverflow.com/questions/4788381/getting-cant-connect-through-socket-tmp-mysql-when-installing-mysql-on-ma/5140849#5140849

© Super User or respective owner

Related posts about mysql

Related posts about osx-lion