CentOS 6.9/7通过yum安装指定版本的MySQL

一、安装

# wget http://repo.mysql.com/mysql57-community-release-el6.rpm && rpm -ivh mysql57-community-release-el6.rpm
# yum install -y mysql-community-server

备注:http://repo.mysql.com这个站点上就是放置rpm源的站点,可以找到其它类型的源。

如果发现系统上有很多个版本的源,可以通过这个命令关掉其它的源,进入/etc/yum.repos.d/直接删除相关的repo文件,或者进去文件进行修改。

查询源:yum repolist all | grep mysql

二、常用服务管理

# 启动
service mysqld start
# 停止
service mysqld stop
# 重启
service mysqld restart
# 重新加载,但不是my.cnf的配置文件
service mysqld reload

CentOS 7:

安装:

# wget http://repo.mysql.com/mysql57-community-release-el7.rpm && rpm -ivh mysql57-community-release-el7.rpm
# yum install -y mysql-community-server

常用服务管理

# 启动
systemctl start mysqld
# 停止
systemctl stop mysqld
# 重启
systemctl restart mysqld
# 重新加载,但不是my.cnf的配置文件
systemctl reload mysqld

猜你喜欢

转载自www.cnblogs.com/EasonJim/p/9052331.html