我在自己的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 : kill: () - 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文件:

[root@37815a453e3e bin]# cd /usr/local/mysql/var
[root@37815a453e3e var]# ll
total
-rw-r----- mysql mysql Sep : 124dc886567c.err
-rw-r----- mysql mysql Sep : 22415a597457.err
-rw-r----- mysql mysql Oct : 37815a453e3e.err
-rw-r----- mysql mysql Sep : 7f92c9fbcaea.err
-rw-r----- mysql mysql Sep : f25f067a6a86.err

发现错误日中有如下错误信息:

--01T14::.741954Z  [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.
--01T14::.744299Z [ERROR] Fatal error: Can't open and lock privilege tables:
  Table storage engine for 'proxies_priv' doesn't have this option
--01T14::.744399Z [ERROR] Aborting

解决办法,对数据目录授权:

[root@6e1de98da6d4 var]# chown -R mysql:mysql /usr/local/mysql/var/
[root@6e1de98da6d4 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!
[root@6e1de98da6d4 var]#

重启mysql服务,启动OK:

[root@37815a453e3e 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"错误解决办法的更多相关文章

  1. ERROR! MySQL server PID file could not be found!的解决方法

    启动MySQL服务 [root@test vhosts]# /etc/init.d/mysqld restart 提示错误: ERROR! MySQL server PID file could no ...

  2. LNMP环境下搭建SVN服务

    最近自己买了个服务器,试着在上面搭建了LNMP环境,因为以前在本地用MAMP Pro搭建过LAMP环境,所以基本上还算是轻车熟路,第一次搭建LNMP,使用的是一键安装,过程是顺利的,后来在使用过程中遇 ...

  3. kafka启动时出现FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) java.io.IOException: Permission denied错误解决办法(图文详解)

    首先,说明,我kafk的server.properties是 kafka的server.properties配置文件参考示范(图文详解)(多种方式) 问题详情 然后,我启动时,出现如下 [hadoop ...

  4. 【MySQL】ERROR 1005: Can't create table (errno: 150)的错误解决办法

    在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...

  5. mysql 启动错误-server PID file could not be found

    [root@centos var]# service mysqld stop MySQL manager or server PID file could not be found!       [F ...

  6. 解决 MySQL manager or server PID file could not be found! 的方法

    [root@centos var]# service mysqld stop MySQL manager or server PID file could not be found!       [F ...

  7. MySQL manager or server PID file could not be found!

    [root@centos var]# service mysqld stop MySQL manager or server PID file could not be found!       [F ...

  8. Docker容器启动时初始化Mysql数据库

    1. 前言 Docker在开发中使用的越来越多了,最近搞了一个Spring Boot应用,为了方便部署将Mysql也放在Docker中运行.那么怎么初始化 SQL脚本以及数据呢? 我这里有两个传统方案 ...

  9. linux搭建的LNMP环境下的mysql授权远程连接

    用phpstudy搭建的lnmp环境下mysql授权远程连接 简单高效 这是因为mysql 里的优先级不是所有人(提前检查防火墙是关闭状态)1.使用phpstudy安装的mysql没有放置到可以直接调 ...

随机推荐

  1. Java并发编程(七)-- ThreadLocal

    提到ThreadLocal,有些Android或者Java程序员可能有所陌生,可能会提出种种问题,它是做什么的,是不是和线程有关,怎么使用呢?等等问题,本文将总结一下我对ThreadLocal的理解和 ...

  2. python基础一 ------简单队列用作历史记录

    #需求:测试历史记录,一个猜字游戏,能在重新进入游戏时查看输入历史# #-*-coding:utf-8-*- from random import randint from collections i ...

  3. MySQL之ORDER BY 详细解析

    1 概述 MySQL有两种方式可以实现ORDER BY: 1.通过索引扫描生成有序的结果 2.使用文件排序(filesort) 围绕着这两种排序方式,我们试着理解一下ORDER BY的执行过程以及回答 ...

  4. 使用Three.js为QQ用户生成3D头像阵列

    东西其实比较简单,就是输出某一范围内QQ账号的3D头像 涉及的技术主要是Three.js的基本使用 而后通过腾讯的接口异步并发请求QQ用户头像,Canavs作图生成Texture应用在球体上 需要注意 ...

  5. python系统编程(二)

    多次fork问题 如果在一个程序,有2次的fork函数调用,是否就会有3个进程呢? #coding=utf-8 import os import time # 注意,fork函数,只在Unix/Lin ...

  6. MyBatis 命名空间与命名解析

    命名空间 使用完全限定名来进一步区分语句. 命名解析 为了减少输入量,MyBatis 对所有的命名配置元素(包括语句,结果映射,缓存等)使用如下的命名解析规则: 完全限定名(比如“com.mypack ...

  7. Egret引擎的常用倒计时

    直接上代码, private timeControl() { let timer: egret.Timer = segret.Timer(); timer.addEventListener(egret ...

  8. 11-15 dom 动态创建节点

    1.生成节点的方法  document.createElement(“div”) 2.插入节点的方法   父元素.appendChild(新节点) 在父节点中的子节点后面插入新的节点 3.在指定的位置 ...

  9. 无脑博士的试管们--dfs搜素

    无脑博士有三个容量分别是A,B,C升的试管,A,B,C分别是三个从1到20的整数,最初,A和B试管都是空的,而C试管是装满硫酸铜溶液的.有时,无脑博士把硫酸铜溶液从一个试管倒到另一个试管中,直到被灌试 ...

  10. mysql:Cannot proceed because system tables used by Event Scheduler were found damaged at server start

    mysql 5.7.18 sqlyog访问数据库,查看表数据时,出现 Cannot proceed because system tables used by Event Scheduler were ...