centos 自帶mysql卸載時出現無法卸載情況
轉載網址:http://blog.csdn.net/frinder/article/details/8165748
[dianyi@localhost ~]$ rpm -qa|grep mysql
mysql-libs-5.1.52-1.el6_0.1.x86_64
[dianyi@localhost ~]$ rpm -e mysql-libs-5.1.52-1.el6_0.1.x86_64
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
[dianyi@localhost ~]$ rpm -e postfix-2:2.6.6-2.2.el6_1.x86_64
error: package postfix-2:2.6.6-2.2.el6_1.x86_64 is not installed
解決辦法:
rpm -e --nodeps mysql-libs-5.1.52-1.el6_0.1.x86_64
error:/usr/bin/perl is needed
[root@os-14 mysql]# rpm -ivh /usr/src/mysql/MySQL-Cluster-server-gpl-7.2.12-1.rhel5.x86_64.rpm
error: Failed dependencies:
/usr/bin/perl is needed by MySQL-Cluster-server-gpl-7.2.12-1.rhel5.x86_64
解決方法:
yum -y install perl
安裝mysql服務端和客戶端
rpm -ivh /opt/MySQL-server-5.5.15-1.linux2.6.x86_64.rpm
rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm
忘記密碼處理
# /etc/init.d/mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <輸入新設的密碼newpassword>
mysql>
參考鏈接:http://blog.seweal.com/post/centos-mysql-install-rpm
http://alsww.blog.51cto.com/2001924/1121676
http://blog.csdn.net/u011045793/article/details/16330055
http://hi.baidu.com/hu_xiu_xiu/item/b7d98bc0a4959b46a8ba94e3