Install mysqlyum-yinstallmysql-server ---------------------------------------------------------- 1 in yum. If the mysql daemon is mysqld, run [root @ localhost ~]. # Servicemysqldstart start MySQL: [OK] if not installed, [root @ localhost ~
Install mysql yum-y install mysql-server ---------------------------------------------------------- 1. If the mysql daemon is mysqld, run [root @ localhost ~]. # Service mysqld start MySQL: [OK] if not installed, [root @ localhost ~
Install mysql in yumYum-y installMysql-Server
----------------------------------------------------------
1. the mysql daemon is mysqld.
If it has been installed:
[Root @ localhost ~] # Service mysqld start
Start MySQL: [OK]
If not installed:
[Root @ localhost ~] # Service mysqld start
Mysqld: unrecognized service
You can check whether your service has been added to linux.
[Root @ localhost ~] # Chkconfig -- list mysqld
Mysqld 0: Disabled 1: Disabled 2: Disabled 3: Disabled 4: Disabled 5: enabled 6: Disabled
If not installed:
[Root @ localhost ~] # Chkconfig -- list mysqld
An error occurred while reading information in the mysqld service. The file or directory does not exist.
Once you start the service, you can check whether the server is running
[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 ~] #
If yes, it indicates that the server has been installed ~~
Check whether apache is installed and version in linux.
If the rpm package is used for installation, run the following command:
Rpm-q httpd
You can also use the following two methods:
Httpd-v
Apachectl-v
How to uninstall mysql in linux
A. Find the installed myslq version:
# Rpm-qa | grep mysql (note the case sensitivity. If mysql doesn't work, change it to MySQL)
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
The installed mysql package name, such as: mysql-5.0.77-4.el5_4.2, is displayed on the screen;
Unmount the searched package name:
# Rpm-e-nodeps mysql-5.0.77-4.el5_4.2 (nodeps indicates force delete)
Prompt
Error: package-nodeps is not installed
Error: package mysql-. 0.77-4. e15 _. 2 is not installed
View mysql installation path in Linux
1. view the File Installation path
Since there are more than one place for software installation, let's first check all the paths (addresses) for File Installation ).
Mysql is used as an example. For example, if I have installed mysql, but I don't know where the files are installed and in which folders, you can use the following command to view all the file paths.
Enter at the terminal:
Whereis mysql
Press enter. If you have installed mysql, the File Installation address will be displayed, for example, my display (the installation address may be different)
[Root @ localhost ~] # Whereis mysql
Mysql:/usr/bin/mysql/usr/lib/mysql/usr/share/man/man1/mysql.1.gz
2. query the path of the running file (Folder address)
If you only need to query the address of the file running file, you can directly use the following command (or take mysql as an example ):
Which mysql
Terminal display:
[Root @ localhost ~] # Which mysql
/Usr/bin/mysql