日志文件路径
mysql>show variables like 'general_log_file'
+------------------+------------------------------------+
| Variable_name | Value |
+------------------+------------------------------------+
| general_log_file | /usr/local/mysql/data/localhost.log |
+------------------+------------------------------------+
1 row in set (0.00 sec)
错误日志文件路径
mysql>show variables like 'log_error'
+---------------+------------------------------------+
| Variable_name | Value |
+---------------+------------------------------------+
| log_error | /usr/local/mysql/data/localhost.err |
+---------------+------------------------------------+
1 row in set (0.00 sec)
慢查询日志文件路径
mysql>show variables like 'slow_query_log_file'
+---------------------+-----------------------------------------+
| Variable_name | Value |
+---------------------+-----------------------------------------+
| slow_query_log_file | /usr/local/mysql/data/localhost-slow.log |
+---------------------+-----------------------------------------+
1 row in set (0.01 sec)
mysql日志没在控制台打印log!更改my.cnf配置文件 [root@git-server ~]# grep general_log /etc/my.cnf general_log = 1 general_log_file =
在mysql命令控制台 *** 作 需要root用户才有访问此文件的权限 默认这个日志是被关闭掉的。 mysql>show global variables like '%general%'+
将日志保存在mysql数据general_log表中!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)