How to close mysql in linux

藏色散人
Release: 2021-12-16 11:36:28
Original
13105 people have browsed it

How to close mysql in Linux: 1. Open the terminal command window; 2. Close mysql by executing the "/usr/local/mysql/bin/mysqladmin shutdown" command.

How to close mysql in linux

The operating environment of this article: windows7 system, mysql version 5.7, Dell G3 computer.

linux How to shut down mysql?

linux startup and shutdown MySQL

It is recommended to use the mysqld_safe command to start, because this command adds With the security feature, when an error occurs in the server, it automatically restarts and records the running information and sends the error to the log file! The command format is as follows:

mysqld_safe options
Copy after login

Common options of the command are as follows:

--datadir=path The directory location of the data file

--help Display the help information of the command

--log-err=file_name Log the error message to the specified file

--nice=priority Execute mysql process priority level

--open-files-limit=count Set the maximum number of files allowed to be opened by mysql

--pid-file=file_name Set the location of the process ID file

--port=number Set the listening port of the mysql server

--usr={user_name|user_id} Specifies the user running the mysql process

101

Start MySql

/usr/local/mysql/bin/mysqld_safe &
Copy after login

#Check the mysql process

ps –ef |grep mysql
Copy after login

Close Mysql

#The kill -9 command cannot kill the mysql process because mysqld_safe will automatically restart. The correct shutdown command is as follows:

/usr/local/mysql/bin/mysqladmin shutdown
Copy after login

Check mysql service status

/usr/local/mysql/bin/mysqladmin status
Copy after login

[Related recommendations: mysql video tutorial

The above is the detailed content of How to close mysql in 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template