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:
-
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:https://stackoverflow.com/questions/1436425/how-do-you-uninstall-mysql-from-mac-os-x
-
Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
Source: https://github.com/mxcl/homebrew/wiki/installation
-
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: https://stackoverflow.com/questions/4359131/brew-install-mysql-on-mac-os/6399627#6399627
- Make MySQL Work
- Create mysql.sock file
touch /tmp/mysql.sock
-
Install MySQL default tables
/usr/local/Cellar/mysql51/5.1.58/bin/mysql_install_db
…or your path
- Create mysql.sock file
Best Answer
Have you tried this.
Download the 64-bit DMG version of MySQL 5.1.x (or 5.5.x) for Mac OS X 10.6 from the official MySQL site and install the package, the startup item and the preference pane.
Add
/usr/local/mysql/bin
to the path:And add:
At the top of file. (Note that we set EDITOR whilst we are here so that svn is happy!)
Set up MySQL root password:
Clear the history file by typing history -c so that {new-password} isn't in plain text on the disk.
Now ensure that the
mysql.sock
file can be found by PHP: Ensure that MySQL is running