原创

Centos7安装mysql57

1.首先进入官网获取RPM包:https://dev.mysql.com/downloads/repo/yum/
直接

wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

2.安装mysql源
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm

3.在线安装 yum -y install mysql-community-server
 。。。。
已安装:
  mysql-community-libs.x86_64 0:5.7.26-1.el7                 mysql-community-libs-compat.x86_64 0:5.7.26-1.el7
  mysql-community-server.x86_64 0:5.7.26-1.el7

作为依赖被安装:
  mysql-community-client.x86_64 0:5.7.26-1.el7                  mysql-community-common.x86_64 0:5.7.26-1.el7

替代:
  mariadb-libs.x86_64 1:5.5.60-1.el7_5

完毕!

3.这就妥了 启动mysqld
systemctl start mysqld

4.修改本地root密码,mysql安装完成之后,在/var/log/mysqld.log文件中给root生成了一个默认密码

[root@bogon ~]# grep 'temporary password' /var/log/mysqld.log
2019-05-25T13:29:46.826677Z 1 [Note] A temporary password is generated for root@localhost: u/q5rpey?raC

#5.然后登录
mysql -h 127.0.0.1 -uroot -p

#6.修改密码:
set password for 'root'@'localhost'=password('root');
支持root用户允许远程连接mysql数据库
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;

5.mysql57已经安装好了

正文到此结束
本文目录