1. 程式人生 > >Docker容器啟動lnmp環境下的mysql服務時報"MySQL server PID file could not be found"錯誤解決辦法

Docker容器啟動lnmp環境下的mysql服務時報"MySQL server PID file could not be found"錯誤解決辦法

我在自己的mac筆記本上裝了一個docker,並在docker容器中安裝了lnmp環境,經常會遇到在使用"lnmp restart"命令啟動lnmp服務的時候,mysql服務啟動失敗,啟動日誌:

Stoping LNMP...
Stoping nginx... nginx is not running.
 ERROR! MySQL server PID file could not be found!
Gracefully shutting down php-fpm /etc/init.d/php-fpm: line 82: kill: (695) - No such process
................................... failed. Use force
-quit Starting LNMP... Starting nginx... done Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/var/37815a453e3e.pid). Starting php-fpm done

找到mysql的資料存放目錄,我的是/usr/local/mysql/var目錄下(這個目錄可以通過/etc/my.cnf中的innodb_data_home_dir屬性檢視),找到以.err結尾對檔案,根據日期檢視最近對err檔案:

[[email protected]
bin]# cd /usr/local/mysql/var [[email protected] var]# ll total 141556 -rw-r----- 1 mysql mysql 27407 Sep 30 16:29 124dc886567c.err -rw-r----- 1 mysql mysql 6924 Sep 30 12:55 22415a597457.err -rw-r----- 1 mysql mysql 20626 Oct 1 17:02 37815a453e3e.err -rw-r----- 1 mysql mysql 41418 Sep 30 11
:05 7f92c9fbcaea.err -rw-r----- 1 mysql mysql 36378 Sep 29 13:42 f25f067a6a86.err

發現錯誤日中有如下錯誤資訊:

2018-10-01T14:05:29.741954Z 0 [Warning] Insecure configuration for --pid-file: 
  Location '/usr/local/mysql/var' in the path is accessible to all OS users.
  Consider choosing a different directory.
2018-10-01T14:05:29.744299Z 0 [ERROR] Fatal error: Can't open and lock privilege tables:
  Table storage engine for
'proxies_priv' doesn't have this option 2018-10-01T14:05:29.744399Z 0 [ERROR] Aborting

解決辦法,對資料目錄授權:

[[email protected] var]# chown -R mysql:mysql /usr/local/mysql/var/
[[email protected] var]# lnmp mysql restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
 ERROR! MySQL server PID file could not be found!
Starting MySQL. SUCCESS! 
[[email protected] var]# 

重啟mysql服務,啟動OK:

[[email protected] var]# lnmp mysql restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Shutting down MySQL.. SUCCESS! 
Starting MySQL. SUCCESS! 

相關推薦

Docker容器啟動lnmp環境mysql服務時報"MySQL server PID file could not be found"錯誤解決辦法

我在自己的mac筆記本上裝了一個docker,並在docker容器中安裝了lnmp環境,經常會遇到在使用"lnmp restart"命令啟動lnmp服務的時候,mysql服務啟動失敗,啟動日誌: Stoping LNMP... Stoping nginx... nginx is not running.

遇到的問題---mysql 啟動錯誤-server PID file could not be found

[[email protected] var]# service mysqld stop MySQL manager or server PID file could not be found!       [FAILED] 解決辦法: 首先檢視一下程序 [[em

MySQL server PID file could not be found!

blog 做的 所有 寫的權限 如果 rate data 重啟 一個個 重啟mysql提示MySQL server PID file could not be found! Starting MySQL...The server quit without updating

mysql報錯 MySQL server PID file could not be found The server quit without updating PID file (/var/l

執行mysql重啟命令突然報錯: 後面的/var/lib/mysql/192.168.1.139.pid給了我們提示 我們進入/var/lib/mysql資料夾  發現了一個好東西  192.168.1.139.err(不用想錯誤資訊肯定在這裡面) 檢視日

MySQL server PID file could not be found! 解決辦法 (李作強)

MySQL server PID file could not be found! 解決辦法 1.可能是/usr/local/mysql/data/rekfan.pid檔案沒有寫的許可權 解決方法 :給予許可權,執行 “chown -R mysql:mysql /var/data” “

MySQL server PID file could not be found! 解決辦法

MySQL server PID file could not be found! 解決辦法 1.可能是/usr/local/mysql/data/rekfan.pid檔案沒有寫的許可權  解決方法 :給予許可權,執行 “chown -R mysql:mysql /var/data

mysql 重啟過程出現MySQL server PID file could not be found![失敗]

service mysql restartMySQL server PID file could not be found![失敗]Starting MySQL...The server quit without updating PID file (/usr/local/m

CentOS MySQL 提示:MySQL server PID file could not be found!

今天在連線測試環境MySQL 時,突然出現如下的錯誤情況: [[email protected] log]# service mysql restart MySQL server PID file could not be found!

mysql報錯問題解決MySQL server PID file could not be found!

MySQL server PID file could not be found!  無法啟動mysql服務 # service mysqld start MySQL server PID file could not be found!                

MySQL is running but PID file could not be found(解決方法)

啟動MySQL時報錯: [[email protected] /]# service mysqld status MySQL is running but PID file could not be found    [失敗]   解決辦法: 找到並kill掉

MySQL is running but PID file could not be found 解決方案

今天碰到一個問題,伺服器異常關閉,mysql無法啟動,檢視mysql 狀態service mysqld status都提示:MySQL is running but PID file could not be found。 解決方法: 使用ps -elf |

在VS2017環境Qt讀寫Excel遇到"無法開啟 源 檔案 'QAxObject'"的錯誤解決辦法

問題: 無法開啟 源 檔案 "QAxObject" 解決辦法: 1、右擊工程 -> 點選 "Create Basic .pro File" 生成一個 .pro 檔案 2、在Resources資料夾裡面找到生成的 .pro 檔案,編輯生成的 .pro 檔案內容,在其

ubuntu16.04環境, Ctrl+Alt+F1 進入終端字元介面 登入出現login incorrect解決辦法

在安裝nvidia驅動的時候,需要ubuntu Ctrl+Alt+F1 進入終端字元介面 登入出現login incorrect解決辦法: 如圖 出現這種情況的原因有兩個: 輸入密碼的時候,不可以用小鍵盤。 在tty介面應先登陸自己的賬號和密碼,如下圖:  

weblogic應用,前端頁面無法啟動,報找不到頁面,重啟服務報“Unable to obtain file lock but will retry”的解決辦法

啟動weblogic的時候報:“Unable to obtain file lock but will retry” 原因:因為伺服器down掉了,weblogic相關程序非正常關閉,導致下次重啟動時候報此類錯誤,不知道還有沒有別的原因,也不知道還有沒有別的解決辦法(殺

64位Windows7環境,Eclipse整合svn後出現Failed to load JavaHL Library的解決辦法

        昨晚幫同事在64位Windows7作業系統中給Eclipse安裝了SVN外掛,外掛安裝好以後每次啟動Eclipse或在Eclipse中建立專案時總會出現如下彈出窗:Failed to load JavaHL Library. These are the err

多個jdk 變更 引起 tomcat插件 啟動不了 The JRE could not be found.Edit the server and change the JRE location.

變更 runtime win jdk nts nvi bsp 選擇 ould The JRE could not be found.Edit the server and change the JRE location. 在Windows->Preference

Spring boot 啟動報錯 'elasticsearchTemplate' that could not be found.

Spring boot 啟動報錯 (a)異常資訊 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 201

Linux檢視防火牆狀態報錯Unit iptables.service could not be found

原文連結:https://blog.csdn.net/sshuidajiao/article/details/82594504 linux下檢視防火牆狀態 [[email protected] src]# service iptables status Redirect

MySQL之——mysql安裝error:the security setting could not be applied

轉載請註明出處:https://blog.csdn.net/l1028386804/article/details/84647325 在安裝mysql時,出現 The security settings could not be applied to the database becau

Hadoop初次啟動時 程序啟動失敗 提示JAVA_HOME is not set and could not be found

初次配置好Hadoop偽分散式式之後,啟動./sbin/start-all.sh  命令發現程序啟動失敗, 如下圖所示 jps 命令檢視程序 發現namenode  datanode 均沒有啟動  提示 JAVA_HOME is not set and could no