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 : 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"错误解决办法的更多相关文章
- 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 ...
- LNMP环境下搭建SVN服务
最近自己买了个服务器,试着在上面搭建了LNMP环境,因为以前在本地用MAMP Pro搭建过LAMP环境,所以基本上还算是轻车熟路,第一次搭建LNMP,使用的是一键安装,过程是顺利的,后来在使用过程中遇 ...
- 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 ...
- 【MySQL】ERROR 1005: Can't create table (errno: 150)的错误解决办法
在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...
- 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 ...
- 解决 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 ...
- 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 ...
- Docker容器启动时初始化Mysql数据库
1. 前言 Docker在开发中使用的越来越多了,最近搞了一个Spring Boot应用,为了方便部署将Mysql也放在Docker中运行.那么怎么初始化 SQL脚本以及数据呢? 我这里有两个传统方案 ...
- linux搭建的LNMP环境下的mysql授权远程连接
用phpstudy搭建的lnmp环境下mysql授权远程连接 简单高效 这是因为mysql 里的优先级不是所有人(提前检查防火墙是关闭状态)1.使用phpstudy安装的mysql没有放置到可以直接调 ...
随机推荐
- PAT (Advanced Level) Practise 1003 解题报告
GitHub markdownPDF 问题描述 解题思路 代码 提交记录 问题描述 Emergency (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题 ...
- [iOS]应用与视图的生命周期和方法调用
1.应用程序的生命周期: AppDelegate类在应用生命周期的不同阶 会回调不同的方法. 视图push到了子界面,然后子界面pop回原界面的时候,会启用viewWillAppear以及之后的几个生 ...
- 英语口语练习系列-C13-聚会
词汇 音频 1. apartment [əˈpɑ:tmənt] n. 公寓 a big / small apartment 一个大的/小的公寓 in an apartment 在公寓 2. arm [ ...
- sql面试题-----行转列
tem数据表如下图 select Time as 日期, sum ( case end ) as 胜, sum ( case end ) as 负 from tem group by Time 执行结 ...
- [CF768G] The Winds of Winter
Discription: 断开树的每一个点会形成一个森林,然后可以进行一次操作:将森林中的一棵树接到另一棵树上.使得森林中size最大的树size最小.依次输出对于每个结点的最小size值 Hint: ...
- Ubuntu安装软件时提示依赖项配置错误
在终端中使用dpkg安装软件时有时会出现依赖项配置错误的情况, 解决方法是使用指令 sudo apt-get install -f 安装Ubuntu 16.04新系统不再配有的缺失依赖项,之后再次输入 ...
- C++程序设计方法1:分离代码
使用头文件,分离声明与定义 防止重复包含: #ifndef FUNC_H #define FUNC_H .... #endif main函数的命令行参数: #include <iostream& ...
- Ruby语法基础(二)
Ruby语法基础(二) 继续ruby的学习,这次主要把目光放到运算符,条件判断,循环,方法,以及其他ruby特有的基本概念上 运算符 算术运算符:+,-,/,%,**,值的注意的是,ruby中一切皆为 ...
- diff比较两个文件 linux
功能:比较两个文件的差异,并把不同地方的信息显示出来.默认diff格式的信息. diff比较两个文件或文件集合的差异,并记录下来,生成一个diff文件,这也是我们常说的补丁文件.也使用patch命令对 ...
- Mysql常用语句/group by 和 having子句
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ explain: ~~~~~~~~~~~~~~~~~ ...