Skip to content

Compile MySQL with Cmake

June 30, 2012

1. Download MySQL source code Generic Linux (Architecture Independent), Compressed TAR Archive from  mysql website.

2. Uncompress the file
tar xvzf mysql-5.5.24.tar.gz
cd mysql-5.5.24

3. Compile
cmake . -DMYSQL_DATADIR=/usr/local/mysql/data/ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
make && make install

4. Create MySQL init script
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on

5. Create MySQL user and MySQL databases
cd /usr/local/mysql/scripts/
./mysql_install_db --verbose --datadir=/usr/local/mysql/data --tmpdir=/tmp --basedir=/usr/local/mysql
chown –R mysql.mysql /var/local/mysql/

6. Start MySQL
service mysqld start

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s