1. 查找mysql
[root@codewen ~]# rpm -q mysql
package mysql is not installed
[root@codewen ~]# whereis mysql
mysql: /usr/lib/mysql /usr/share/mysql
[root@codewen ~]#
2. 卸载mysql
yum remove mysql-libs
3. 清空DB缓存
yum clean dbcache
4. 下载MySQL rpm安装包
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
5. 安装下载的rpm包
rpm -ivh mysql-community-release-el6-5.noarch.rpm
6. yum安装mysql
yum install mysql-community-server
如果这一步出现问题,请设置DNS 8.8.8.8,114.114.114.114
7. 启动服务
service mysqld start
8. 进入mysql,默认密码是空
mysql -uroot
9. 修改root密码
#在MYSQL里修改
#使用mysql
use mysql;
#更改密码
update user set password=PASSWORD("root") where user='root'
#退出
quit
10. 重新mysql服务
service mysqld restart