linux怎么查看mysql是否启动

发布网友 发布时间:2022-04-23 01:26

我来回答

1个回答

热心网友 时间:2022-05-05 04:21

【1】ps -ef|grep mysqld 看看是否有mysqld_safe 和mysqld进程
[root@localhost ~]# ps -ef|grep mysqld
显示结果:
1)root 4052 29869 0 10:25 pts/0 00:00:00 grep mysqld
2)root 30905 1 0 10:14 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/localhost.localdomain.pid
3)mysql 31231 30905 1 10:14 pts/0 00:00:09 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid --socket=/tmp/mysqld.sock --port=3306
【2】如果已添加到系统服务中,可以service mysqld status
[root@localhost ~]# service mysqld status
显示结果:
SUCCESS! MySQL running (31231)

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com