dibaliklayar

Tuesday, February 14, 2006

Installing Mysql 5 in RHEL 4 from RPMs

This is a fresh install of RHEL 4 with apache2 webserver that come with cd.

Get the RPM
-http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-server-standard-5.0.18-0.rhel4.i386.rpm/from/pick
-http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-client-standard-5.0.18-0.rhel4.i386.rpm/from/pick
-http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-devel-standard-5.0.18-0.rhel4.i386.rpm/from/pick
-http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-shared-standard-5.0.18-0.rhel4.i386.rpm/from/pick

install all package using RHEL package installer. Right click on the package and choose install package. if you did not get any dependency error then continue, if not please solve the dependency error by installing all required package.

what I do after this is go to prompt and type
root~>mysql

if you can get through the your installation is done. if not and get this error

Error after installation
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


If your installing in a 2.6 kernel, either disable SELinux or set a new policy before trying to install MySQL-server. Without it the mysql_install_db and mysqld steps of the RPM will fail.

Here is the medicine if you forgot to do the above

you have to check the SELinux configuration. see http://forums.mysql.com/read.php?11,7164,7164

you can disable selinux for mysql so mysql will have no trouble starting up.
in RHEL go to

Application>system setting>security level configuration
click the SELinux tab
expand the SELinux Service Protection and check the 'Disable SELinux protection for mysqld daemon'
then click ok

try to restart the mysql.

if you still get this error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

go to /var/lib/mysql, this is the default place where mysql install its data.
open mysql folder, if this folder is empty then you have to install the database file for mysql

run this
root~>/usr/bin/mysql_install_db

it should create the base tables for mysql and try to start your new mysql again.

0 Comments:

Post a Comment

<< Home