1.获取mysql安装包
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
2.安装mysql
yum install mysql mysql-server
3.数据库启动,并访问
systemctl start mysqld
mysql -u root
4.授权远程访问
use mysql;
grant all privileges on *.* to root@'%' identified by "root";
FLUSH PRIVILEGES;
5.修改登录密码
use mysql;
update user set password=password('123') where user='root';
flush privileges;