当前位置:网站首页>MySQL 数据库 报错 The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid)
MySQL 数据库 报错 The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid)
2022-08-05 07:57:00 【nihui123】
导语
由于服务器掉电,导致数据库连接不了,网上找了很多的例子,什么权限不够的,什么需要跑初始化脚本的?都没有及时快速的解决问题,反而是带来了更大的问题。
如图所示,数据库服务一启动就是这个报错。查了好久
解决办法
直接找到/etc目录下的my.cnf 的文件将下面这段配置替换到其中。然后根据自己的目录配置进行修改
[mysqld]
bind-address=0.0.0.0
port=3306
user=mysql
## 这个地方修改为个人配置的路径
basedir=/usr/local/mysql
datadir=/data/mysql
socket=/tmp/mysql.sock
log-error=/data/mysql/mysql.err
pid-file=/data/mysql/mysql.pid
#character config
character_set_server=utf8mb4
symbolic-links=0
explicit_defaults_for_timestamp=true
这里需要注意的一点就是如果配置不合适,会出现如下的报错,但是不用担心,你所配置的路径下面一定有一个pid的文件。所以要么就是直接指定文件,要么就是删除,在数据库服务启动之后,会重新创建。
最终完美启动
方法真实有效,如果不合适请在评论区@博主,博主一定帮助解决!
边栏推荐
猜你喜欢
随机推荐
TRACE32——C源码关联1
SVG Star Wars Style Toggle Toggle Button
达梦数据库大表添加字段
iptables实现网络限制下ntp自定义端口同步时间
软件系统测试和验收测试有什么联系与区别?专业软件测试方案推荐
作为一个男人必须明白的22个道理
【深度学习实践(一)】安装TensorFlow
SQL SERVER关于主从表触发器设计
JVM运行流程,运行时数据区,类加载,垃圾回收,JMM解析
[Structural Internal Power Cultivation] The Mystery of Enumeration and Union (3)
TensorFlow安装步骤
Use of thread pool (combined with Future/Callable)
TensorFlow installation steps
【win7】NtWaitForKeyedEvent
游戏模拟器成了外挂帮凶,灰产对抗再升级
每一个女孩曾经都是一个没有泪的天使
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
数据库——概述
TRACE32——SMP多核调试
Invalid operator for data type.The operator is add and the type is text.