Found option without preceding group in config file /etc/my.cnf at line 1

Viewed 629

I haven't found anything online that's helped me address this error. I had to uninstall mysql, and I used this guide to uninstall. Then I reinstalled it. I got this error:

mysqld: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

So I uninstalled again, and attempted to uninstall the my.cnf file as well. After reinstalling a second time, I opened my.cnf and my.cnf.default files and [mysqld] is at the very top, with nothing (no comments or space) above it. I also checked to make sure that the files are in UTF-8. I still get this error when running brew postinstall mysql.

Here's what my.cnf file looks like, I moved the comments to the bottom to see if it would fix it:

[mysqld]
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
# Default Homebrew MySQL server config
# Only allow connections from localhost

If anyone has any insight that would be greatly appreciated. I'm running MacOS Big Sur.

0 Answers
Related