CentOS 7.7 yum 在线安装MySQL 5.7.37

1、下载 MySQL Yum Repository (联网下载yum源地址)

wget -c https://repo.mysql.com//mysql80-community-release-el7-5.noarch.rpm

2.添加 MySQL Yum Repository(下载安装yum源)

[root@node1 ~]# yum localinstall mysql80-community-release-el7-5.noarch.rpm

3、选择安装发行版

禁用8.0:yum-config-manager --disable mysql80-community
启用5.7:yum-config-manager --enable mysql57-community

查看:启用的数据库安装源

[root@node1 ~]# yum repolist enabled | grep mysql
	mysql-connectors-community/x86_64       MySQL Connectors Community           230
	mysql-tools-community/x86_64            MySQL Tools Community                138
	mysql57-community/x86_64                MySQL 5.7 Community Server           564

4、在线安装

yum install mysql-community-server

5、启动数据库

[root@node1 ~]# systemctl enable --now mysqld

6、验证数据库的三种方式

	1.查看状态:[root@node1 ~]# systemctl status mysqld
	2.查看端口:[root@node1 ~]# netstat -lnpt | grep :3306
	3.查看进程:[root@node1 ~]# ps -ef | grep mysqld

	查询临时密码(两种方式):
		1.grep 'temporary password' /var/log/mysqld.log
		2.awk '/temporary password/ {print $NF}' /var/log/mysqld.log
 登录:mysql -uroot -p
 密码:
 登陆后需要修改密码才能正常操作mysql
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值