Ich versuche Logs auf meinem MySQL Server zu aktivieren, aber ohne Erfolg. Was ich getan habe:Logs in MySQL konnten nicht aktiviert werden - Fehler: Gefundene Option ohne vorhergehende Gruppe in der Konfigurationsdatei
1) Ich habe die Protokolldatei mit den richtigen Berechtigungen erstellt haben:
touch /var/log/mysql/mysql.log
chown mysql:mysql /var/log/mysql/mysql.log
2) ich die notwendige Änderung der my.cnf
Datei hinzugefügt haben:
general_log_file = /var/log/mysql/mysql.log
general_log = 1
Meine my.cnf
Datei ist die folgende:
#
# 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/
general_log_file = /var/log/mysql/mysql.log
general_log = 1
Ich bin nicht in der Lage MySQL neu zu starten, und wenn ich um die Protokollierung versuchen, ich habe diesen Fehler:
error: Found option without preceding group in config file: /etc/mysql/my.cnf at line: 23 Fatal error in defaults handling. Program aborted
Was bedeutet das und wie kann ich dieses Problem beheben?
ich Ubuntu 15.05 mit MySQL bin mit 5.6.24-0ubuntu2
In der Tat hat es funktioniert, danke! Für mich ergibt das keinen Sinn ... – hg8
Das hat auch für mich funktioniert, aber leider erklärt die Antwort nicht das Warum. – armadadrive
@armadadrive Sie haben Recht. Die Ursache hängt mit der Fehlermeldung zusammen: "Option ohne vorherige Gruppe in der Konfigurationsdatei gefunden". Mit dem Tag [mysqld] können Sie die Gruppe (den Namen des Programms) deklarieren, für die Sie Optionen festlegen möchten. – juanra