Mysql 報錯PID file could not be found!解決辦法

來源:互聯網
上載者:User

今天想把之前在cetnos6上編譯安裝的mariadb改下PATH環境變數,操作幾次之後,關閉或重啟mysql就失敗了,提示如下:


[root@web1 ~]# service mysqld stop
MySQL server PID file could not be found!                  [FAILED]
google了下,解決方案如下:


查看一下進程:


[root@web1 ~]# ps aux |grep mysq*
mysql     16058  0.2 11.2 995540 112956 ?       Sl   14:07   0:01 mysqld
root      17233  0.0  0.0 103316   848 pts/2    S+   14:16   0:00 grep mysq*


如果看到上面的內容,那說明,Mysql的進程卡死了,這時用就要把這些卡死的進程都關閉:


[root@web1 ~]# kill -9 16058
[root@web1 ~]# kill -9 17233
-bash: kill: (17233) - No such process


再啟動Mysql 就行了;可以多重啟幾次,最後就成功啟動了。

[root@web1 ~]# service mysqld stop
MySQL server PID file could not be found!                  [FAILED]
[root@web1 ~]# service mysqld restart
MySQL server PID file could not be found!                  [FAILED]
Starting MySQL..                                           [  OK  ]
[root@web1 ~]# service mysqld restart
Shutting down MySQL.                                       [  OK  ]
Starting MySQL..                                           [  OK  ]
[root@web1 ~]#

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.