I am getting the following error when trying to access mysql:
mysql: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 22! mysql: [ERROR] Fatal error in defaults handling. Program aborted!
/etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
bind-address = 127.0.0.1
general_log_file = /var/log/mysql/mysql.log
general_log = 1
Any help would be appreciated.
cnf is located in /etc/mysql/my. cnf .
All options in your my.cnf need to be within a "group" like:
[mysqld]
bind-address 127.0.0.1
The group in this example is "mysqld". The group is named by a line preceding the options, and the name of the group is in square brackets.
Your file doesn't have any group identifier named before you start giving options.
Read https://dev.mysql.com/doc/refman/5.7/en/option-files.html for more details on how to format MySQL option files.
In my case the group is [mysql]
So just put [mysql]
at the beginning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With