要在 CentOS 上启动 MySQL 8 服务,请按照以下步骤操作:
sudo yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo yum install -y mysql-community-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
sudo systemctl status mysqld
如果服务正在运行,您将看到类似以下的输出:
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-06-21 10:00:00 UTC; 1min ago
Main PID: 12345 (mysqld)
CGroup: /system.slice/mysqld.service
└─12345 /usr/sbin/mysqld --defaults-extra-file=/etc/my.cnf
现在,您已经成功启动了 CentOS 上的 MySQL 8 服务。