一、yum 安装 wgethtml
yum install wget
二、下载MySQL 的yum repomysql
wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
三、安装 mysql57-community-release-el7-11.noarch.rpmsql
yum install -y mysql57-community-release-el7-11.noarch.rpm
四、查看是否安装成功spa
yum list |grep mysql
五、修改yum仓库源code
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
六、正式安装server
yum -y install mysql-community-server
七、查看安装结果htm
yum list installed|grep mysql
八、查看MySQL服务状态blog
systemctl status mysqld
九、启动MySQL服务get
systemctl start mysqld
十、修改MySQL root密码it
grep "password" /var/log/mysqld.log mysql -uroot -p set global validate_password_policy=0; set global validate_password_length=0; ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
十一、开启远程访问
use mysql
select host,user from user;
update user set host='%' where user='root';
flush privileges;
十二、打开防火墙3306端口