Linux 如何查看 Red Hat 中是否安装了 MySQL?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5974403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 00:54:41  来源:igfitidea点击:

How to find whether MySQL is installed in Red Hat?

linuxredhatstatus

提问by satheesh.droid

I am currently using Red Hat linux. I just want to find out whether MySQL is installed in that system. If yes where is it located? can anyone help please...

我目前正在使用 Red Hat linux。我只是想知道该系统中是否安装了 MySQL。如果是,它位于哪里?谁能帮忙请...

回答by Echo419

If you're looking for the RPM.

如果您正在寻找 RPM。

rpm -qa | grep MySQL

Most of it's data is stored in /var/lib/mysql so that's another good place to look.

它的大部分数据都存储在 /var/lib/mysql 中,因此这是另一个查看的好地方。

If it is installed

如果安装了

which mysql

will give you the location of the binary.

会给你二进制文件的位置。

You could also do an

你也可以做一个

updatedb

and a

和一个

locate mysql

to find any mysql files.

找到任何mysql文件。

回答by Ankit

Type mysql --versionto see if it is installed.

键入mysql --version以查看是否已安装。

To find location use find -name mysql.

要查找位置,请使用find -name mysql.

回答by sweaves

yum list installed | grep mysql

yum list installed | grep mysql

Then if it's not installed you can do (as root)

然后如果它没有安装你可以做(​​以root身份)

yum install mysql -y

回答by Roberto

Usually you can find a program under a subdirectory "../bin". System programs are under /usr/bin or /bin. To check where files of mysql package are placed, on RHEL 6 type like this :

通常你可以在子目录“../bin”下找到一个程序。系统程序在/usr/bin 或/bin 下。要检查 mysql 包文件的放置位置,在 RHEL 6 上键入如下:

rpm -ql mysql(which is the main part of the package)

rpm -ql mysql (这是包的主要部分)

and the result is a list of "exe" files such as "mysqladmin" tool. About to know the version of the server, run the command:

结果是“exe”文件列表,例如“mysqladmin”工具。即将知道服务器的版本,运行命令:

mysqladmin -u "valid-user" version

mysqladmin -u "有效用户" 版本

回答by user3011664

rpmquery <package Name>By this command you can check which package is installed.

rpmquery <package Name>通过此命令,您可以检查安装了哪个软件包。

For Example: rpmquery mysql

例如: rpmquery mysql

回答by Jacob Abraham

to ckeck the status use the below command, which worked on debian....

要检查状态,请使用以下命令,该命令适用于 debian....

/etc/init.d/mysql status

/etc/init.d/mysql 状态

to start my sql server use the below command

使用以下命令启动我的 sql server

/etc/init.d/mysql start

/etc/init.d/mysql 启动

to stop the server use the below command

停止服务器使用以下命令

/etc/init.d/mysql stop

/etc/init.d/mysql 停止