MAC 无法启动mysql:The server quit without updating PID file

执行命令

sudo /usr/local/mysql/support-files/mysql.server start

报错如下 

my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.

my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!

Starting MySQL

.my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.

my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!

my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.

my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!

Logging to '/usr/local/mysql/data/macdeMacBook-Pro.local.err'.

 ERROR! The server quit without updating PID file (/usr/local/mysql/data/macdeMacBook-Pro.local.pid).

 

参考:https://blog.csdn.net/object_oriented_/article/details/105219941

1、

 在/opt/mysql/mysql-5.7.25/support-files目录下创建my_default.cnf    touch my_default.cnf

复制如下内容至my_default.cnf

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
 
 
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 
basedir = /opt/mysql/mysql-5.7.29
datadir = /opt/mysql/mysql-5.7.29/data
port = 3306
socket = /tmp/mysql.sock
character-set-server=utf8
 
log-error = /opt/mysql/mysql-5.7.29/data/mysqld.log
pid-file = /opt/mysql/mysql-5.7.29/data/mysqld.pid

这些路径可见mysql configuration

2、拷贝文件至/etc

sudo cp support-files/my_default.cnf /etc/my.cnf

如果提示是否覆盖,y

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值