Source: www.cnblogs.com/ttrrpp/p/12…

Install Yum Repository

[root@localhost ~]# wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
Copy the code

Use RPM to install MySQL

[root@localhost ~]# rpm -ivh mysql80-community-release-el8-1.noarch.rpm
Copy the code

Install mysql service with yum

[root@localhost ~]# yum install mysql-server
Copy the code

Check whether the MySQL service has been enabled upon startup

[root@localhost ~]# systemctl list-unit-files|grep mysqld
mysqld.service disabled
mysqld@.service disabled

[root@Localhost ~]# create symlink localhost ~]# create symlink localhost ~]# create symlink The/etc/systemd/system/multi - user. Target. Wants/mysqld. Service to/usr/lib/systemd/system/mysqld. Service. [root@localhost ~]# systemctl list-unit-files|grep mysqld
mysqld.service enabled
mysqld@.service disabled
[root@Localhost ~] # ps - ef | grep mysql root # check whether to start the mysql service4311 32702 0 21:07 pts/4 00:00:00 grep --color=auto mysql
[root@Localhost ~]# systemctl start mysqld.serviceCopy the code