Saturday, December 25, 2010

Just install Mysql 5.5.8 from Source

I downloaded mysql source, then installed. On previous versions, we can see "configure" file, but mysql 5.5.8 (No such file)

Remark:
Preconfiguration
# groupadd mysql
# useradd -r -g mysql mysql
- Download source and install.
# ls -l mysql-5.5.8.tar.gz
-rw-r--r-- 1 root root 24258297 Dec 25 18:26 mysql-5.5.8.tar.gz
# tar zxvf mysql-5.5.8.tar.gz
# ls -l mysql-5.5.8/configure
ls: mysql-5.5.8/configure: No such file or directory
On MySQL 5.5, CMake is used as the build framework on all platforms. Check Docs!!! for source installation.
# mkdir build
# cd build/
# cmake ../mysql-5.5.8
-bash: cmake: command not found
- Need to install cmake before.
# ls -l cmake-2.8.3.tar.gz
-rw-r--r-- 1 root root 5436543 Dec 25 18:17 cmake-2.8.3.tar.gz
# tar zxvf cmake-2.8.3.tar.gz
# cd cmake-2.8.3
# ./configure
# gmake
# gmake install
- Then try again.
# cmake ../mysql-5.5.8
# make
# make install
It's installed at /usr/local/mysql PATH.
# chown -R mysql /usr/local/mysql
# chgrp -R mysql /usr/local/mysql
# /usr/local/mysql/scripts/mysql_install_db --user=mysql
# chown -R root /usr/local/mysql
# chown -R mysql /usr/local/mysql/data
# cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf
# /usr/local/mysql/bin/mysqld_safe --user=mysql &
# /usr/local/mysql/bin/mysql
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.5.8 |
+-----------+
If we don't need to install default PATH (/usr/local/mysql), we can use "-DCMAKE_INSTALL_PREFIX=dir_name" option. Example:
# cmake ../mysql-5.5.8 -DCMAKE_INSTALL_PREFIX="/usr/local/MySQL-5.5"
Check more MySQL Source-Configuration Options

OK... enjoy and Merry Christmas.

1 comment:

Shahryar Ghazi said...

detailed tutorial on the subject

http://www.geeksww.com/tutorials/database_management_systems/mysql/installation/download_configure_compile_and_install_mysql_558_on_linux.php