【问题标题】:unable to start mysql server. Error preceding group in config无法启动 mysql 服务器。配置中的前组错误
【发布时间】:2016-02-20 11:52:58
【问题描述】:

所以我已经尝试了 2-3 个小时来解决安装 mysql 时的几个问题。 现在,我目前被困在这个:

输入时:mysql.server restart

这会在终端打印出来:

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!
 ERROR! MySQL server PID file could not be found!
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
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook.local.pid).

我的my.cnf 文件包含以下内容:(并且位于~/etc

[mysqld_safe]
 [mysqld]
 [client]
port        = 3306
skip-external-locking
bind-address        = 127.0.0.1
key_buffer          = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size   = 8
myisam-recover         = BACKUP
query_cache_limit   = 1M
query_cache_size    = 16M
log_error                = /var/log/mysql/error.log
expire_logs_days    = 10
max_binlog_size     = 100M
query-cache-type = 1
default-storage-engine=innodb 
[mysqldump]
quick
quote-names
max_allowed_packet  = 16M
 
[mysql]
[isamchk]
key_buffer      = 16M

非常感谢任何帮助。

【问题讨论】:

  • 尽量不要缩进 [mysqld][client] 行。
  • 还是同样的错误@Barmar
  • Google 获取错误消息,您会在许多不同的论坛中找到许多主题。可能您的问题与其中之一相同。
  • 已经尝试过了,因此我转向这里寻求建议@Barmar

标签: mysql macos terminal homebrew


【解决方案1】:

粘贴 my.cfn 中的代码并使用 sublime text 2 保存它就可以了...

【讨论】:

  • 您可能在文件中有一些不可见的字符,如我在评论中链接到的问题所示。
猜你喜欢
  • 2021-09-27
  • 1970-01-01
  • 2019-11-25
  • 2014-11-29
  • 1970-01-01
  • 1970-01-01
  • 2013-12-08
  • 2021-10-18
相关资源
最近更新 更多