centos7上安装mysql-5.7.27

mysql安装包
链接:https://pan.baidu.com/s/1IOhXIqc6y7nY3ZZTxreeIw
提取码:qds3
1.1解压mysql安装包

[root@bigdata101 usr]# cd local/src/mysql
[root@bigdata101 mysql]# tar -xvf mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar -C /usr/local/src/mysql/

1.2在Mysql解压路径下删除依赖包

[root@bigdata101 mysql]# yum remove mysql-libs

1.3下载包

[root@bigdata101 mysql]# yum -y install perl
[root@bigdata101 mysql]# yum -y install net-tools

1.4进入mysql解压包

[root@bigdata101 mysql]# rpm -vih mysql-community-common-5.7.27-1.el7.x86_64.rpm
[root@bigdata101 mysql]# rpm -vih mysql-community-libs-5.7.27-1.el7.x86_64.rpm
[root@bigdata101 mysql]# rpm -vih mysql-community-libs-compat-5.7.27-1.el7.x86_64.rpm
[root@bigdata101 mysql]# rpm -vih mysql-community-client-5.7.27-1.el7.x86_64.rpm
[root@bigdata101 mysql]# rpm -vih mysql-community-server-5.7.27-1.el7.x86_64.rpm

1.5查看Mysql安装包

[root@bigdata101 mysql]# rpm -qa | grep mysql
mysql-community-libs-5.7.27-1.el7.x86_64
mysql-community-common-5.7.27-1.el7.x86_64
mysql-community-client-5.7.27-1.el7.x86_64
mysql-community-server-5.7.27-1.el7.x86_64

1.6启动Mysql,查看初始密码

[root@bigdata101 mysql]# systemctl start mysqld
[root@bigdata101 mysql]# cat /var/log/mysqld.log | grep password
2020-05-21T04:21:13.739352Z 1 [Note] A temporary password is generated for root@localhost: Zq+B)Nf-k3(R

root@localhost:后面的就是初始密码
1.7使用初始密码登录Mysql

[root@bigdata101 mysql]# mysql -u root -p
Enter password: 

1.8修改密码
进入mysql
centos7上安装mysql-5.7.27_第1张图片修改密码策略为low

mysql> set global validate_password_policy=low;

修改你的密码

musql>ALTER USER 'root'@'localhost' identified by '你的密码';

撒花撒花,现在mysql在centos7上可以用啦!

你可能感兴趣的:(centos7上安装mysql-5.7.27)