安装wget,用于下载mysql包使用
yum install wget
下载mysql源
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
安装mysql
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum module disable mysql
yum -y install mysql-community-server
启动mysql
systemctl start mysqld.service
查看mysql默认密码
grep "password" /var/log/mysqld.log
访问mysql
mysql -uroot -p # 回车后会提示输入密码,拷贝上一步看到的密码即可
修改mysql密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Aa.123456';
设置mysql可以被其他机器链接
grant all on *.* to root@'%' identified by 'Aa.123456';
删除yum mysql源
yum -y remove mysql57-community-release-el7-10.noarch