Thursday, January 16, 2014

Installing MySQL on Mac OS X

Before you are download, ensure your architecture of Mac:
Oper your terminal and type
uname -a
and the result are:
Darwin aruls-mbp 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
The "RELEASE_X86_64 x86_64", it's mean your computer is using 64 Bit architecture computer.

Firstly, download the MySQL 64 Bit software





Double click at file "mysql-5.6.15-osx10.7-x86_64.dmg" and will appear popup like this:













Ok, next step is:

Install the mysql-5.6.15-osx10.7-x86_64.dmg
Install the MySQLStartupItem.pkg
Install the MySQL.prefpane

















Then click "Start MySQL Server" and "Check Automatically Start on startup"
We need do something to using "mysql" command work on the Terminal, follow the step
Open up your terminal:
vi ~/.profile
Use the "i" key, to insert mode, then paste this line:
"export PATH=$PATH:/usr/local/mysql/bin"


















Hit the ‘Esc’ key to exit insert mode and type “:wq” and hit enter to write and quit the editor. Close the terminal window and open a new one. You can then enter this command:
mysql -u root -p
Set MySQL password
/usr/local/mysql/bin/mysqladmin -u root password SECRET
Setting the Socket The last command we'll need to run in terminal will allow Apache and PHP to access MySQL:
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

No comments:

Post a Comment