Install mysql 5.5.13 in rhel4
// Author: guojin. chen
I. rpm Installation
1. Prepare the package:
MySQL-server-5.5.13-1.rhel4.i386.rpm
MySQL-client-5.5.13-1.rhel4.i386.rpm
2. check whether there are any old mysql versions.
Rpm-q mysql
If yes, it will be detached. According to the constraints, it will be detached from the most external.
Rpm-e package
3. Installation
Rpm-ivh MySQL-server-5.5.13-1.rhel4.i386.rpm MySQL-client-5.5.13-1.rhel4.i386.rpm
4. default installation directory
/Var/lib/mysql data file directory
/Usr/share/mysql configuration file directory
/Usr/bin program directory
/Etc/rc. d/init. d/mysql Startup Script
5. Start | terminate | view the server
/Etc/rc. d/init. d/mysql start | stop | status
/Usr/bin/mysqladmin-u root-ppassword shutdown
6. Change the data file directory
Mv/var/lib/mysql/data/
Cp/usr/share/mysql/my-medium.cnf/etc/my. cnf
Vi/etc/my. cnf
Modify the socket =/data/mysql. sock of the client and mysqld groups
Vi/etc/rc. d/init. d/mysql
Modify datadir =/data/mysql
7. Start the server. If an error is reported in the log, "/usr/sbin/mysqld: Can't change dir to '/data/mysql/' (Errcode: 13 )"
It should be related to selinux,
Solution:
Vi/etc/selinux/config
Modify selinux = disabled or permissive
Start the server again. OK.
8. If the server can be started but the client cannot be connected, the socket in the client group in my. cnf has not been changed.