我不知道这个问题是否特定于我的设置,但是当我添加行
时log = /var/log/mysql.log
复制my-large.cnf文件的mysqld部分并尝试重新启动mysql服务器我收到错误
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/centos-server.pid).
我已经创建了文件/var/log/mysql.log,将其所有者和组设置为mysql并将/ var / log上的权限设置为777(暂时)
我正在使用mysql 5.6.5 m8(开发版本)。
这是my.cnf文件的片段
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
log = /var/log/mysql.log
答案 0 :(得分:2)
似乎log指令已过时且my.cnf需要指令
general-log = 1
如果这样指定,日志文件将在默认位置创建(在centos上是/var/lib/mysql/centos-server.log)