mysql升级到5.6源

时间:2023-12-25 16:02:31

###更新mysql的yum源
wget http://dev.mysql.com/get/mysql-community-release-el6-4.noarch.rpm
### 安装新的mysql源
yum install mysql-community-release-el6-4.noarch.rpm
### 安装新版本的mysql
yum install mysql mysql-server

### 启动时提示有错
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
的提示。如果直接输入 mysql -root -p登陆会出现[mysql]ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)的错误提示。总之MySql服务器端总是无法启动。网上的提供很多解决方法也没有效果。最后通过如下方法解决:

rm -fr /var/lib/mysql/*
rm /var/lock/subsys/mysqld
killall mysqld

### 再次启动
service mysqld start
### 修改密码
/usr/bin/mysqladmin -u root password "123"