Installing MySQL 5.5.20 from Source on Mac OS X 10.5 Leopard, 10.6 Snow Leopard and 10.7 Lion

-Prerequisites

Become the SuperUser:

sudo su

Install cmake (Need MacPorts):

port install cmake

Set the Path to bison:

PATH=$PATH:$(dirname $(which bison))

-Pre-installation

If do Not already Exists make:

mkdir ~/src

Access Target Path:

cd ~/src

Check that User and Group mysql already Exists:

dscl . -read /Users/mysql
dscl . -read /Groups/mysql

If didn't get any Output follow the Guide on included in the File INSTALL-SOURCE to Create mysql User and Group.

Download mysql Source Code:

http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.20.tar.gz/from/ht...

If link not working go to http://dev.mysql.com/downloads Select "Community Server" >> "Source Code" >> "Generic Linux, Compressed TAR Archive" Move the Downloaded Archive to:

mv ~/src

Untar mysql Archive:

tar xvzf mysql-5.5.20.tar.gz

Set the Right Ownerships:

chown -R mysql mysql*
chgrp -R mysql mysql*

Access MySQL Dir:

cd mysql

-Installation

Configuring mysql Source:

/opt/local/bin/cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/usr/local/mysql/data/ \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DINSTALL_LAYOUT=STANDALONE -DENABLED_PROFILING=ON \
-DMYSQL_MAINTAINER_MODE=OFF -DWITH_DEBUG=OFF

Make mysql:

make

Install mysql: Make:

make install

If All Processes Arrive to 100% without Errors you Got a New Working MySQl! -Post-installation: Create the Starting MySQL db: scripts/mysql_install_db --user=mysql Start the MySQL Server: ./bin/mysqld_safe & Setup MySQL: ./bin/mysql_secure_installation

-Post-installation

Create the Starting MySQL db:

cd /usr/local/mysql
scripts/mysql_install_db --user=mysql

Start the MySQL Server:

./bin/mysqld_safe &

Setup MySQL:

./bin/mysql_secure_installation

Add MySQL Binaries to the PATH

nano /etc/bashrc

Insert

export PATH=/usr/local/mysql/bin:$PATH

Load New PATH

bash

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer