centos7 yum安装mysql
第一步:下载yum源
wget 'https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm'
第二步:安装yum源
rpm -ivh mysql57-community-release-el7-11.noarch.rpm
第三步:安装MySQL
yum install -y mysql-community-server
第四步(获取root密码):
grep "password" /var/log/mysqld.log
第五步(修改密码):
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
第六步(开启远程访问):
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;