centos快速安装mysql5.7

 

[root@prom yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

 

[root@prom yum.repos.d]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm 

[root@prom yum.repos.d]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm 

[root@prom yum.repos.d]# yum -y install mysql-server 

 

[root@prom yum.repos.d]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
[root@prom yum.repos.d]# grep "password" /var/log/mysqld.log   查看密码

2021-06-16T10:24:16.905771Z 1 [Note] A temporary password is generated for root@localhost: 2Zg(?KCj5cT!

[root@prom yum.repos.d]# mysql -u root -p  

mysql> alter user 'root'@'localhost' identified by 'Sunny@123';

mysql> flush privileges;

mysql> quit

mysql> grant all on *.* to 'test'@'%' identified by 'Sunny@123' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

 

 

22

posted @ 2021-06-16 10:39  wang_wei123  阅读(35)  评论(0编辑  收藏  举报