I had earlier installed mysql-5.1.50-osx10.6-x86_64.dmg and then uninstalled it using the below command (found on Stack Overflow):
$ sudo rm /usr/local/mysql $ sudo rm -rf /usr/local/mysql* $ sudo rm -rf Library/StartupItems/MySQLCOM $ sudo rm -rf /Library/PreferencePanes/My* $ rm -rf ~/Library/PreferencePanes/My* $ sudo rm -rf /Library/Receipts/mysql* $ sudo rm -rf /Library/Receipts/MySQL* $ sudo vi /etc/hostconfig $ sudo rm -rf /var/db/receipts/com.mysql.mysql* $ cd /Library/Receipts/
Then I have tried to reinstall from mysql-5.5.9-osx10.6-x86_64.dmg.
However I am getting the following error:
The installation failed
The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.