Saturday, February 11, 2012

Building MySQL 5.5.20 on CentOS 5.7 from Source Tarball

Install the following package using yum. Please remember to run yum using root.
shell> yum install cmake
shell> yum install ncurses-devel
shell> yum install gcc-c++

Download the Source Code
At the time of this blog, the current version of MySQL to be installed is version 5.5.20. The source tarball can be downloaded from

Unpack the Source Code
Run the following command to extract the MySQL 5.5.20 source tarball.
shell> gunzip -dc mysql-5.5.20.tar.gz | tar xvf -

Building the Source Code
Assuming MySQL 5.5.20 to be installed to the directory /opt/mysql-5.5.20 on the CentOS 5.7.
shell> cd mysql-5.5.20
shell> cmake . -DCMAKE_INSTALL_PREFIX=/opt/mysql-5.5.20 -DCURSES_LIBRARY=/usr/lib/ -DCURSES_INCLUDE_PATH=/usr/include
shell> make
shell> make install
shell> cd /opt/mysql-5.5.20
shell> chown -R mysql:mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
shell> cp support-files/mysql.server /etc/init.d/mysql.server

Startup and Shutdown Script
Login as root and run the following command to start or stop MySQL Server.
To Start MySQL 5.5.20: /etc/init.d/mysql.server start
To shutdown MySQL 5.5.20: /etc/init.d/mysql.server stop


  1. I've been surfing on-line more than 3 hours as of late, yet I by no means discovered any interesting article like yours. It is pretty value enough for me. In my opinion, if all webmasters and bloggers made just right content material as you did, the net might be much more useful than ever before. paypal login my account


  2. What's Happening i am new to this, I stumbled upon this I have discovered It positively useful and it has aided me out loads. I am hoping to give a contribution & help other users like its helped me. Great job. outlook 365 login