1. Download the installation package mysql-5.1.52-osx10.6-x86.dmgfrom http://dev.mysql.com/downloads/mysql/
2. Double-click the installation package. One of the four files is the description document.
3, first click Install mysql-5.1.52-osx10.6-x86.pkg, this is the main installation package of MySQL. Generally, the installation file automatically installs MySQL under/usr/local. For example, clicking run mysql-5.1.52-osx10.6-x86.pkg will install mysq into/usr/local/mysql-5.1.52-osx10.6-x86. The installation is complete by default.
4. Click to install the 2nd file mysqlstartupitem. PKG, so that MySQL will automatically start at startup.
5. Click to install MySQL 3rd files. prefpane. In this way, the icon "MySQL" is displayed in "system setting Preferences", through which you can set whether MySQL starts or stops and whether it runs automatically at startup. MySQL is basically installed.
6. Switch to the root user su root and enter the password.
7. Run chmod + w/etc/bashrc to modify the permission of the file to be writable by the owner.
8. Run "VI/etc/bashrc" and add the alias of MySQL and mysqladmin to the bash configuration file.
9. Click "I" on the keyboard as the inserted state and copy the following content:
#mysql alias mysql='/usr/local/mysql/bin/mysql' alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
10. Click ESC on the keyboard and enter: X to save and exit.
11. Run PWD to check whether the current directory is etc. If so, enter chmod 444 bashrc and press Enter.
12. After installing le, the default MySQL Root Password is blank. To set the password, Run "mysqladmin-u Root Password" 123456 "on the terminal, 123456 is the root password.
13. Start the MySQL Service
14. Enter mysql-u root-P on the terminal and enter the password.
Post: http://cainwise.iteye.com/blog/814973