查看linux安装的mysql
时间: 2023-11-14 22:08:45 浏览: 76
linux_install_mysql.doc
您可以通过以下命令查看Linux系统上是否安装了MySQL:
```
systemctl status mysql
```
如果MySQL已经安装并正在运行,您将看到类似于以下内容的输出:
```
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-10 14:20:00 UTC; 1 weeks 0 days ago
Main PID: 1234 (mysqld)
Tasks: 28 (limit: 4915)
Memory: 1.2G
CGroup: /system.slice/mysql.service
└─1234 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Aug 10 14:20:00 ubuntu systemd[1]: Starting MySQL Community Server...
Aug 10 14:20:00 ubuntu systemd[1]: Started MySQL Community Server.
```
如果MySQL未安装,则会显示“Unit mysql.service could not be found.”的错误消息。
阅读全文