rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
5.7的源:http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
安装mysqlyum install mysql-community-server
运行mysqldsystemctl start mysqld
查看mysqld的运行状态和一些初始化的提示systemctl status mysqld
可以看到设置默认密码的几种方式
/usr/bin/mysqladmin -u root password 'new-password'
开机启动mysqldsystemctl enable mysqld
授权远程访问mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> grant all privileges on . to root@'%' identified by "password";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
打开3306端口的访问firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload