1.下载MySQL连接工具
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
2.使用rpm来安装MySQL链接工具
rpm -ivh mysql80-community-release-el8-1.noarch.rpm
3.使用yum安装mysql服务
yum install mysql-server
4.设置MySQL为开机启动服务(centos8)
- 先查看当前是否为开机服务
[root@localhost ~]# systemctl list-unit-files|grep mysqld
mysqld.service disabled
mysqld@.service disabled
此时服务为未开启状态 disabled
- 设置为开机启动
systemctl enable mysqld.service
- 再次确定是否为开机启动服务
[root@localhost ~]# systemctl list-unit-files|grep mysqld
mysqld.service enabled
mysqld@.service disabled
此时为enable,即为开机启动服务