Home > Database > Mysql Tutorial > How to check whether mysql is installed on linux

How to check whether mysql is installed on linux

藏色散人
Release: 2021-12-06 14:23:18
Original
20647 people have browsed it

How to check whether mysql is installed on Linux: 1. Open the terminal command window; 2. Execute the command "service mysqld start" or "chkconfig --list mysqld" command.

How to check whether mysql is installed on linux

The operating environment of this article: linux5.9.8 system, mysql5.5, DELL G3 computer

How to check whether mysql is installed on linux ?

linux Check whether MySQL is installed:

yum install mysql

yum -y install mysql-server
Copy after login

1, the daemon process of mysql is mysqld

If it has been installed:

[root@localhost ~]# service mysqld start
启动 MySQL:                                               [确定]
Copy after login

If it has not been installed:

[root@localhost ~]# service mysqld start
mysqld:未被识别的服务
Copy after login

You can see if your service has been added to linux

[root@localhost ~]# chkconfig --list mysqld
mysqld          0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:启用  6:关闭
Copy after login

If it has not been installed:

[root@localhost ~]# chkconfig --list mysqld
Copy after login

An error occurred while reading information in the mysqld service. There is no such file or directory

Once you start the service, you can check whether the server is running like this

[root@localhost ~]# ps -el | grep mysqld
4 S     0  1796     1  0  85   0 -  1513 wait   ?        00:00:00 mysqld_safe 
4 S    27  1856  1796  0  78   0 - 34055 -      ?        00:00:00 mysqld 
[root@localhost ~]#
Copy after login

If you If you see it, it means that the server is installed~~

Check whether apache is installed and its version under Linux

If Tong is installed through the rpm package, use the following directly Command:

rpm -q httpd
Copy after login

You can also use the following two methods:

httpd   -v  
apachectl   -v
Copy after login

Uninstall mysql method under linux Uninstall mysql under linux

a. Find the installed myslq version:

   #rpm  -qa | grep  mysql (注意大小写,如果mysql 不行就换MySQL)
Copy after login

Display:

[root@localhost ~]# rpm  -qa | grep  mysql
mysql-5.0.77-4.el5_4.2 
mysql-server-5.0.77-4.el5_4.2 
php-mysql-5.2.13-1.el5.art
Copy after login

The installed mysql package name will be displayed on the screen, such as: mysql-5.0.77-4.el5_4.2;

The searched out Uninstall package name:

#rpm -e  –nodeps mysql-5.0.77-4.el5_4.2  (nodeps表示强制删除)
Copy after login

Tips

error: package –nodeps is not installed 
error: package mysql-.0.77-4.e15_.2 is not installed
Copy after login

Linux view mysql installation path

1. View file installation path

Due to software There is more than one installation place, so let’s first check all the paths (addresses) of the file installation.

Here is mysql as an example. For example, I installed mysql, but I don’t know where the files are installed or in which folders. You can use the following command to view all file paths

Enter in the terminal:

whereis mysql
Copy after login

Enter, if you have installed mysql, the address of the file installation will be displayed, such as my display (the installation address may be different)

[root@localhost ~]# whereis mysql 
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
Copy after login

2. Query the path of the running file (folder address)

If you only want to query the address of the running file of the file, just use the following command (still use mysql as an example):

which mysql
Copy after login

Terminal display:

[root@localhost ~]# which mysql 
/usr/bin/mysql
Copy after login

Recommended Study: "mysql video tutorial"

The above is the detailed content of How to check whether mysql is installed on linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template