如题。

1、云服务器终端,控制台。查看当前linux版本:

cat /etc/redhat-release

  显示:

CentOS Linux release 8.2.2004 (Core)

2、在mysql官网查找对应的源,并下载:

https://dev.mysql.com/downloads/repo/yum/

我的linux是8.2,所以使用“ Oracle Linux 8”对应的源。

下载

wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

运行结果

腾讯云centos8.2下安装mysql8

 

 3、安装软件包

先解决旧版本的GPG keys造成的安装警告

rpm --import /etc/pki/rpm-gpg/RPM* 

再安装

sudo rpm -Uvh mysql80-community-release-el8-1.noarch.rpm --force --nodeps

运行截图

腾讯云centos8.2下安装mysql8

 

 4、安装mysql

查看mysql相关资源

 yum repolist all | grep mysql

运行结果

腾讯云centos8.2下安装mysql8

 

 安装

yum install mysql-server

按提示,回复一个“y”,安装完毕。以下为部分截图

腾讯云centos8.2下安装mysql8

 

 5、启动服务,查看状态

systemctl start mysqld.service
 systemctl status mysqld.service

服务正常启动(部分截图)。(终端出现end,按q键退出)

腾讯云centos8.2下安装mysql8

 

 6、修改密码

默认密码为空,进入mysql

 mysql -u root -p

修改密码命令

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

由于云服务器的mysql端口(默认3306)在防火墙里没有开放,故此处弱密码安全。

真实使用环境应使用强密码。

7、完成,测试:创建数据库d1,表t1……

腾讯云centos8.2下安装mysql8

 完成!

相关文章:

  • 2021-12-21
  • 2021-10-11
  • 2021-10-17
  • 2021-07-31
  • 2021-07-06
  • 2021-09-17
  • 2021-06-24
  • 2021-11-06
猜你喜欢
  • 2022-01-10
  • 2021-04-30
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案