yum安装MySQL5版本

网址
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述//导入下载好的文件

[root@192 ~]# ls
anaconda-ks.cfg  mysql80-community-release-el7-3.noarch.rpm
[root@192 ~]# rpm -ivh mysql80-community-release-el7-3.noarch.rpm 
warning: mysql80-community-release-el7-3.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql80-community-release-el7-3  ################################# [100%]

//yum默认安装8.0版本,修改为默认下载5.7版本

[root@192 ~]# cd /etc/yum.repos.d/
[root@192 yum.repos.d]# vim mysql-community.repo 

在这里插入图片描述

[root@192 yum.repos.d]# yum clean all
[root@192 yum.repos.d]# yum repolist 

//安装

[root@192 yum.repos.d]# yum -y install mysql-community-server.x86_64 
[root@192 yum.repos.d]# systemctl start mysqld
[root@192 yum.repos.d]# netstat -anput | grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN      2427/mysqld

//查看默认密码登入MySQL

[root@192 yum.repos.d]# grep password /var/log/mysqld.log 
2020-11-20T19:26:06.421478Z 1 [Note] A temporary password is generated for root@localhost: n)_&wpYeh9P:

[root@192 yum.repos.d]# mysql -uroot -p'n)_&wpYeh9P:'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.32

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

//修改root密码

mysql> alter user root@localhost identified by '123.comTT';
Query OK, 0 rows affected (0.00 sec)

mysql> 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

神奇的海马体

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值