1.安装mysql-server
yum install mysql-server
2.备份数据库
mysqldump -u xxx -h xxx -P 3306 -p --all-databases > databases.sql
3.停止mysql服务
service mysqld stop
4.卸载旧版的mysql
yum remove mysql mysql-*
5.查看已安装的mysql扩展,并卸载
rpm -qa¦grep mysql
yum remove mysql mysql-server mysql-libs compat-mysql51
yum list installed | grep mysql
yum remove mysql-libs
6.安装mysql5.7
rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
6.1安装
yum install mysql-community-server
7.查看版本号
mysql -v
8.启动mysql服务
service mysqld start
9.初始化mysql5.7
mysqld --initialize
rm -rf /var/lib/mysql
service mysqld start
10.启动服务的时候根据提示修改密码
/usr/bin/mysqladmin -u root password '123456'
11.状态设置
chkconfig mysqld on
chkconfig --list
netstat -antp
service mysqld status