centos7安装MySQL

先去MySQL官网找到下载链接(https://dev.mysql.com/downloads/repo/yum/)

下载安装

执行下面的命令下载并安装MySQL

1
2
3
4
wget http://repo.mysql.com/mysql80-community-release-el7-2.noarch.rpm
rpm -Uvh mysql80-community-release-el7-2.noarch.rpm
yum update
yum install mysql-community-server

启动MySQL服务器

执行下面的命令启动MySQL

1
service mysqld start

执行下面的命令检测MySQL状态

1
service mysqld status

参考

https://dev.mysql.com/downloads/repo/yum/