[root@localhost support-files]# /etc/init.d/mysqld status
ERROR! MySQL is not running
[root@localhost support-files]#
启动mysql服务
[root@localhost support-files]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS![root@localhost support-files]# /etc/init.d/mysqld status
SUCCESS! MySQL running (9271)[root@localhost support-files]#
停止mysql服务
[root@localhost support-files]# /etc/init.d/mysqld stop
Shutting down MySQL.. SUCCESS![root@localhost support-files]#
重启mysql服务
[root@localhost support-files]# /etc/init.d/mysqld restart
ERROR! MySQL server PID file could not be found!
Starting MySQL. SUCCESS![root@localhost support-files]#
配置修改后重新加载mysql服务
[root@localhost support-files]# /etc/init.d/mysqld reload
SUCCESS! Reloading service MySQL
[root@localhost support-files]#
systemctl 运行mysql
启动mysql服务
systemctl start mysqld
停止mysql服务
systemctl stop mysqld
mysql的运行状态
[root@localhost ~]# systemctl status mysqld
● mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysqld; generated)
Active: active (running) since Sat 2021-07-03 17:07:55 CST; 2min 24s ago
Docs: man:systemd-sysv-generator(8)
Process: 1483 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=0/SUCCESS)
Tasks: 38 (limit: 11362)
Memory: 439.5M
CGroup: /system.slice/mysqld.service
├─1494 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local>
└─1721 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugi>
7月 03 17:07:52 localhost.centos8 systemd[1]: Starting LSB: start and stop MySQL...
7月 03 17:07:55 localhost.centos8 mysqld[1483]: Starting MySQL... SUCCESS!
7月 03 17:07:55 localhost.centos8 systemd[1]: Started LSB: start and stop MySQL.