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.
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
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 &
#Check the mysql process
ps –ef |grep mysql
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
Check mysql service status
/usr/local/mysql/bin/mysqladmin status
[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!