How to end the mysql process

下次还敢
Release: 2024-04-22 19:42:12
Original
443 people have browsed it

There are two ways to end the MySQL process: the direct method uses the kill command, which is not recommended; the elegant method uses the mysqladmin command, which requires the user to have SHUTDOWN permissions and confirm termination by checking the process status. On Windows, you can use the taskkill command to forcefully end a process.

How to end the mysql process

How to end the MySQL process

Direct method

can be used The following command directly ends the MySQL process:

kill <进程 ID>
Copy after login

whereis the ID of the MySQL process.

Elegant method

In order to avoid data corruption, it is recommended to use the following elegant method to end the MySQL process:

  1. Notification The MySQL server stopped running:

    mysqladmin shutdown
    Copy after login
  2. Wait for the MySQL process to terminate:

    Use the following command to check if the MySQL process is still running:

    ps -ef | grep mysql
    Copy after login

    If the MySQL process no longer appears in the results, the process has terminated successfully.

Note:

  • Using the elegant method requires the MySQL user to have SHUTDOWN permission.
  • On Windows, you can use thetaskkillcommand to end the process. The syntax is as follows:

    taskkill /pid <进程 ID> /f
    Copy after login

The above is the detailed content of How to end the mysql process. 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 Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!