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 http://downloads.mysql.com/archives/mysql-5.0/mysql-5.0.91.tar.gz
$ 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

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
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 indra.office.com password 'new-password'

Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation

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 mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
=======================================================
Sumber :

http://blog.pnyet.web.id/2011/04/15/installing-mysql-from-source.html
http://forums.mysql.com/read.php?10,214837,214946#msg-214946
http://www.geeksww.com/tutorials/database_management_systems/mysql/installation/downloading_compiling_and_installing_mysql_server_from_source_code.php

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.

Software
Billigt Flyg London