centos 6.x yum mysql 5.7

a.下载包

打开 https://dev.mysql.com/downloads/repo/yum/ 选择对应版本

点击下一download 后,复制 No thanks, just start my download. 上的连接

下载:

wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm

 

b.安装用来配置mysql的yum源的rpm包

rpm -Uvh mysql57-community-release-el6-9.noarch.rpm

yum localinstall -y mysql57-community-release-el6-9.noarch.rpm

安装成功后在/etc/yum.repos.d/

2.安装mysql

yum install mysql-community-server

3.开启mysql服务

service mysqld start

4.默认密码
启动后创建的超级用户'root'@'localhost' 密码被存储在/var/log/mysqld.log
命令查看密码
grep 'password' /var/log/mysqld.log

使用mysql生成的'root'@'localhost'用户和密码登录数据库,并修改默认密码
shell> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';