1.下载MySQL源
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
2.安装MySQL源
sudo rpm -ivh mysql57-community-release-el7-7.noarch.rpm
3.安装mysql-community-server
sudo yum install mysql-community-server -y
4.重启mysqlsystemctl restart mysqld
注:自动启动服务用 systemctl enable mysql
5.查看临时密码grep 'A temporary password' /var/log/mysqld.log
2015-12-24T08:04:50.296020Z 1 [Note] A temporary password is generated for root@localhost: I(eKs9PyklP_
6.用临时密码登录mysql并修改root密码,新增用户,打开远程访问>mysql -uroot -pEnter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15Server version: 5.7.10 MySQL Community Server (GPL)Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names m