Starting MySQLERROR! The server quit without updating PID file (/usr/local/mysql/data/xxx)遇到的坑

当MySQL服务器出现错误'ERROR! The server quit without updating PID file'时,可能是因为缺少默认配置文件my.cnf。通过查找my.cnf的位置,手动创建并设置权限,然后按照特定步骤关闭并重启MySQL服务,可以解决此问题。
摘要由CSDN通过智能技术生成

在这里插入图片描述
mysql 好好的突然出现了问题,在网上看了很多种解决方案也没解决了。自己弄了一上午,也没弄好。
在这里插入图片描述
在这里插入图片描述
今天晚上看了一下自己的 my.cnf文件是空的,原来是mysql在新版中去掉了默认配置文件my.cnf如果需要可以手动创建。
可以通过命令: mysql --verbose --help | grep my.cnf

在这里插入图片描述

找到文件 :sudo vim /etc/my.cnf
写入内容:

# Example MySQL config file for medium systems.  
  #  
  # This is for a system with little memory (32M - 64M) where MySQL plays  
  # an important part, or systems up to 128M where MySQL is used together with  
  # other programs (such as a web server)  
  #  
  # MySQL programs look for option files in a set of  
  # locations which depend on the deployment platform.  
  # You can copy this option file to one of those  
  # locations. For information about these locations, see:  
  # http://dev.mysql.com/doc/mysql/en/option-files.html  
  #  
  # In this file, you can use all long options that a program supports.  
  # If you want to know which options a program supports, run the program  
  # with the "--help" option.  
  # The following options will be passed to all MySQL clients  
  [client]
  default-character-set=utf8
  #password   = your_password  
  port        = 3306  
  socket      = /tmp/mysql.sock   
  # Here follows entries for some specific programs  
  # The MySQL server  
  [mysqld]
  character-set-server=utf8
  init_connect='SET NAMES utf8
  port        = 3306  
  socket  
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值