如何确定mariadb是否启动
时间: 2024-04-03 19:32:43 浏览: 134
可以通过以下步骤来确定MariaDB是否启动:
1. 打开终端或命令提示符窗口。
2. 在终端或命令提示符中输入以下命令:
```
systemctl status mariadb
```
3. 如果MariaDB正在运行,将会看到类似以下内容的输出:
```
● mariadb.service - MariaDB 10.3.17 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-01-23 14:19:29 EST; 3 weeks 6 days ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 1747 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 31 (limit: 4915)
Memory: 145.4M
CGroup: /system.slice/mariadb.service
└─1747 /usr/sbin/mysqld --daemonize --pid-file=/run/mariadb/mariadb.pid
Jan 23 14:19:27 centos7 systemd[1]: Starting MariaDB 10.3.17 database server...
Jan 23 14:19:29 centos7 systemd[1]: Started MariaDB 10.3.17 database server.
```
4. 如果MariaDB未运行,将会看到类似以下内容的输出:
```
● mariadb.service - MariaDB 10.3.17 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Jan 23 14:19:27 centos7 systemd[1]: Starting MariaDB 10.3.17 database server...
Jan 23 14:19:29 centos7 systemd[1]: Started MariaDB 10.3.17 database server.
```
其中 `Active: inactive (dead)` 表示MariaDB未运行。
阅读全文