我在自己的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. linux 学习笔记 finding people

    #who 或者 #w 展示所有登录到当前系统的用户信息 #who am i 展示真是用户信息 #whoami  展示登陆系统的用户名 例如 : 登陆用户和真实用户一致 #whoami root #wh ...

  2. MySQL 安装包下载教程

    http://www.mysql.com/downloads/

  3. 2019-1-9 c#时间格式

    DateTime now=DateTime.Now; //获取拼接形式的,精确到毫秒 now.ToString("yyyyMMddHHmmssfff"); //获取时间戳 自公元0 ...

  4. 2017-9-14-Linux移植:加快Linux主机的启动速度

    参考文章:http://www.mintos.org/skill/fast-boot.html 今天本来不打算写Blog了,Linux笔记本开机太慢了,浪费生命.何不干脆写一篇关于加快Linux主机启 ...

  5. Java中的public、private、protected,函数修饰符

    1.public:public表明该数据成员.成员函数是对所有用户开放的,项目中其他脚本都可以直接进行调用 2.private:private表示私有,私有的意思就是除了脚本之外,项目中其他类都不可以 ...

  6. fatal: You are not currently on a branch. 问题解决

    fatal: You are not currently on a branch. 解决 注:亲试,这种方法会把本地的修改给冲掉,所以事先一定要备份下文档,之后覆盖,重新上传或pull即可:解决方法: ...

  7. GMA Round 1 最大值

    传送门 最大值 求$f(x)=cos(x)+\sqrt{cos^2(x)-4\sqrt{3}cos(x)+4\sqrt{2}sin(x)+10}$的最大值.保留到小数点后3位. $f(x)+\sqrt ...

  8. JAVA自学笔记24

    JAVA自学笔记24 1.能使用同步代码块就使用同步代码块,除非锁对象是this,就可以考虑使用同步方法.静态方法的锁是类的字节码对象. 2.JDK5新特性 1)接口Lock void Lock()/ ...

  9. CSS关键词的值-currentColor关键字提示文字(当前颜色)

    currentColor关键字 currentColor关键字相当于一个CSS变量. currentColor关键字与CSS变量也是有区别的: (1)他只可以能接受<color>值的地方使 ...

  10. JSP解决:Attempt to clear a buffer that&#39;s already been flushed错误(jsp:forward标签跳转空白)

    [摘要:本日正在开辟过程当中发明一个题目:正在页里中应用了jsp:forward扔错Attempt to clear a buffer that's already been flushed!! 百思 ...