简体   繁体   English

如何检查linux机器中是否安装了mysql?

[英]How To Check mysql is installed in linux machine or not?

In my case I am trying 就我而言

mysql --version

so it is showing 所以它显示

mysql  Ver 15.1 Distrib 5.5.35-MariaDB, for Linux (x86_64) using readline 5.1

but when I am giving 但是当我给

service mysql status

It showing path is not available ,please help to find out mysql server is installed or not in particular linux machine. 它显示path is not available ,请帮助查找特定的linux机器上是否已安装mysql服务器。

You need to check existense of binaries: 您需要检查二进制文件的existense:

  • mysql ( which mysql ) if you need to check client existence mysql( which mysql ),如果您需要检查客户端是否存在
  • mysqld ( which mysqld_safe or which mysqld ) if you need to check server existence mysqld( which mysqld_safewhich mysqld ),如果您需要检查服务器是否存在

On debian it could be done using dpkg : 在debian上,可以使用dpkg来完成:

dpkg -s mysql-server

returns 回报

Package: mysql-server
Status: install ok installed
[...]

or 要么

dpkg-query: package 'mysql-server' is not installed and no information is available

same for mysql-client 对于mysql-client

Try this simple step if you are using Ubantu OS. 如果您使用的是Ubantu OS,请尝试以下简单步骤。 Go to search>> Ubantu software center(type in search)>>Installed(click)>>Developer Tools(click)(then it will show that mysql software is installed or not) 转到搜索>> Ubantu软件中心(在搜索中键入)>>已安装(单击)>>开发人员工具(单击)(然后它将显示是否已安装mysql软件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM