rpm -qa|grep mysql
检查所有的Mysql相关的包...
都是4.7版本的,所以一口气全部 rpm -e mysql .............删除掉了
rmp -ivh 安装了以下包:
MySQL-client-standard-5.0.26-0.rhel4.i386.rpm
MySQL-devel-standard-5.0.26-0.rhel4.i386.rpm
MySQL-server-standard-5.0.26-0.rhel4.i386.rpm
MySQL-shared-compat-5.0.26-0.rhel4.i386.rpm
MySQL-shared-standard-5.0.26-0.rhel4.i386.rpm
MySQL-test-standard-5.0.26-0.rhel4.i386.rpm
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h xiaobai5213 password 'new-password'
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
service mysql start
Starting MySQL.................. [失败]
/usr/bin/mysqladmin -u root password '123456'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
发现这个文件没有了: /var/lib/mysql/mysql.sock
在看系统日志(/var/log/messages)内容如下:
Nov 22 19:57:23 xiaobai5213 htt_server[2374]: status has not been enabled yet. (1, 4)
Nov 22 19:57:24 xiaobai5213 htt_server[2374]: status has not been enabled yet. (1, 1)
Nov 22 19:57:39 xiaobai5213 kernel: audit(1164196659.819:0): avc:
denied { append } for pid=3443exe=/usr/sbin/mysqld
path=/var/lib/mysql/xiaobai5213.err dev=sda10 ino=313490
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_lib_t
tclass=file
Nov 22 19:57:39 xiaobai5213 kernel: audit(1164196659.819:0): avc:
denied { append } for pid=3443exe=/usr/sbin/mysqld
path=/var/lib/mysql/xiaobai5213.err dev=sda10 ino=313490
scontext=root:system_r:mysqld_t tcontext=root:object_r:var_lib_t
tclass=file
Nov 22 19:57:39 xiaobai5213 kernel: audit(1164196659.824:0): avc:
denied { write } for pid=3443 exe=/usr/sbin/mysqld
dev=sda10 ino=313289 scontext=root:system_r:mysqld_t
tcontext=root:object_r:var_lib_t tclass=dir
Nov 22 19:57:39 xiaobai5213 kernel: audit(1164196659.824:0): avc:
denied { write } for pid=3443 exe=/usr/sbin/mysqld
dev=sda10 ino=313289 scontext=root:system_r:mysqld_t
tcontext=root:object_r:var_lib_t tclass=dir
Nov 22 19:57:39 xiaobai5213 kernel: audit(1164196659.849:0): avc:
denied { write } for pid=3443 exe=/usr/sbin/mysqld
dev=sda10 ino=313289 scontext=root:system_r:mysqld_t
tcontext=root:object_r:var_lib_t tclass=dir
原来我安装多了一个包
MySQL-shared-compat-5.0.26-0.rhel4.i386.rpm
还有要把"安装级别配置"的SElinux关掉...
解决方法:
卸载所有MySQL的包,然后关掉"安装级别配置"的SElinux
安装以下包:
MySQL-client-standard-5.0.26-0.rhel4.i386.rpm
MySQL-devel-standard-5.0.26-0.rhel4.i386.rpm
MySQL-server-standard-5.0.26-0.rhel4.i386.rpm
MySQL-shared-standard-5.0.26-0.rhel4.i386.rpm
MySQL-test-standard-5.0.26-0.rhel4.i386.rpm
service mysql start
OK .. 成功lo
标签: