Choose Your Language

28 October 2012

Install MySQL di Centos dengan configure (dari source code)

Kali ini mari kita coba install MySQL 5.0.91 di Centos dengan cara configure / dari source. Memang lebih sulit daripada kita menginstall dengan yum ataupun rpm. Saya membuatnya karena ada server production yang masih memakai Centos versi lama dimana repositorynya sudah tidak ada dan juga tidak ada CD Centos versi tersebut di kantor. Berikut caranya, saya menginstallnya di folder /home/indra/mysql-5.0.91/

$ wget
$ tar xzf mysql-5.0.91.tar.gz
$ cd mysql-5.0.91
$ ./configure --prefix=/usr/local/mysql
$ make
$ make install
$ cp /home/indra/mysql-5.0.91/support-files/my-medium.cnf /etc/my.cnf
$ groupadd mysql
$ useradd -g mysql mysql
$ cd /usr/local/mysql
$ chown -R mysql .
$ chgrp -R mysql .
$ /home/indra/mysql-5.0.91/scripts/mysql_install_db --user=mysql
$ chown -R root .
$ chown -R mysql var
$ /usr/local/mysql/bin/mysqladmin -u root password 123
$ cp /home/indra/mysql-5.0.91/support-files/mysql.server /etc/init.d/mysql
$ chmod +x /etc/init.d/mysql
$ /etc/init.d/mysql start
$ chkconfig mysql on
$ export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
$ ps aux |grep mysql

Bila PID MySQL sudah ada maka MySQL sudah dapat dijalankan.


To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h password 'new-password'

Alternatively you can run:

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe

You can test the MySQL daemon with
cd mysql-test ; perl
Sumber :,214837,214946#msg-214946

1 comment:

Mobile App Developers said...

What you're saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I'm sure you'll reach so many people with what you've got to say.

Billigt Flyg London