今天运维的重做了个虚机环境用来部署我们项目的测试环境,装redhat as4.由于项目中用的mysql5,系统自带mysql4.1.20应该先去掉。
#rpm -qa|grep mysql
找到若干个包
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.20-1.RHEL4.1
# rpm -e mysql-4.1.20-1.RHEL4.1
error: Failed dependencies:
libmysqlclient.so.14 is needed by (installed) cyrus-sasl-sql-2.1.19-5.EL4.i386
# rpm -e cyrus-sasl-sql-2.1.19-5.EL4.i386
# rpm -e mysql-4.1.20-1.RHEL4.1
# rpm -e mysqlclient10-3.23.58-4.RHEL4.1
# rpm -qa|grep mysql
没有内容,证明已经删除干净
安装mysql5
# rpm -i MySQL-server-5.5.10-1.rhel4.i386.rpm
#rpm -i MySQL-client-5.5.10-1.rhel4.i386.rpm
完成登录msyql5,这时候出问题了
# mysqladmin -u root password 'root'
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!
# /etc/rc.d/init.d/mysql status
MySQL is not running [FAILED]
# /etc/rc.d/init.d/mysqld status
-bash: /etc/rc.d/init.d/mysqld: No such file or directory
# service mysql start
Starting MySQL... [ OK ]
# mysqladmin -u root password 'root'
# mysql -uroot -proot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
问题解决。