• 使用kill无法杀死mysql进程


    问题背景:由于忘记了root密码,在没有关闭mysqld的进程时候,又执行了mysqld_safe --skip-grant-tables --skip-networking & 命令

    然后发现mysql开启了两个进程

    ps -ef|grep mysql|grep -v mysql
    root       6528   5942  0 15:26 pts/3    00:00:00 /bin/sh /application/mysql/bin/mysqld_safe --skip-grant-tables
    mysql      6684   6528  1 15:26 pts/3    00:00:08 /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=db01.err --pid-file=db01.pid --socket=/tmp/mysql.sock --port=3306
    
    [root@db01:~]# netstat -tunlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1491/sshd
    tcp6       0      0 :::3306                 :::*                    LISTEN      6684/mysqld
    tcp6       0      0 :::22                   :::*                    LISTEN      1491/sshd
    

    使用kill、pkill、killall都无法杀死mysql进程,一直会重新启动一个新的进程,systemctl stop mysqld.service这个命令也不管用

    /application/mysql/bin/mysqld_safe: line 198:  6684 Killed                  nohup /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=db01.err --pid-file=db01.pid --socket=/tmp/mysql.sock --port=3306 < /dev/null > /dev/null 2>&1
    2019-09-08T07:36:25.218090Z mysqld_safe Number of processes running now: 0
    2019-09-08T07:36:25.225914Z mysqld_safe mysqld restarted
    /application/mysql/bin/mysqld_safe: line 198:  7025 Killed                  nohup /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=db01.err --pid-file=db01.pid --socket=/tmp/mysql.sock --port=3306 < /dev/null > /dev/null 2>&1 > /dev/null 2>&1
    2019-09-08T07:36:39.819259Z mysqld_safe Number of processes running now: 0
    2019-09-08T07:36:39.825030Z mysqld_safe mysqld restarted
    /application/mysql/bin/mysqld_safe: line 198:  7071 Killed                  nohup /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=db01.err --pid-file=db01.pid --socket=/tmp/mysql.sock --port=3306 < /dev/null > /dev/null 2>&1 > /dev/null 2>&1 > /dev/null 2>&1
    2019-09-08T07:36:59.687319Z mysqld_safe Number of processes running now: 0
    2019-09-08T07:36:59.693581Z mysqld_safe mysqld restarted
    /application/mysql/bin/mysqld_safe: line 198:  7117 Killed                  nohup /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=db01.err --pid-file=db01.pid --socket=/tmp/mysql.sock --port=3306 < /dev/null > /dev/null 2>&1 > /dev/null 2>&1 > /dev/null 2>&1 > /dev/null 2>&1
    2019-09-08T07:37:07.345563Z mysqld_safe Number of processes running now: 0
    2019-09-08T07:37:07.352287Z mysqld_safe mysqld restarted
    

    后来使用/application/mysql/support-files/mysql.server stop停止成功

  • 相关阅读:
    作为字节跳动的面试官,有些话我不得不说!
    阿里面试 Java 都问什么?万字总结!
    离职10天,面挂4家公司!
    Nginx 又一牛 X 功能:流量拷贝
    金三银四铜五铁六,Offer收到手软!
    在阿里干了5年招聘,这10条建议我必须分享给你!
    nyoj 1238 最少换乘(dijkstra)
    hdu 1035 Robot Motion(模拟)
    网络工程 POST与GET请求方法的本质区别
    hdu 1279 验证角谷猜想(简单的模拟)
  • 原文地址:https://www.cnblogs.com/hejian2836/p/11486925.html
Copyright © 2020-2023  润新知