mysql日志配置(linux与windows)
mysql有以下几种日志:
1. 错误日志
2. 通用查询日志
3. 慢速查询日志
3. 更新日志
复制代码代码如下:
用--log-update[=file_name]选项启动,不推荐使用。
是否启用了日志 mysql>show variables like 'log_%'; 怎样知道当前的日志 mysql> show master status; 显示二进制日志数目 mysql> show master logs; 看二进制日志文件用mysqlbinlog shell>mysqlbinlog mail-bin.000001 或者shell>mysqlbinlog mail-bin.000001 | tail
在配置文件中指定log的输出位置。 linux下:
复制代码代码如下:
# 在[mysqld] 中加入
# 在[mysqld] 中加入 #log windows下:
复制代码代码如下:
# 在[mysqld] 中加入
# 在[mysqld] 中加入 开启慢查询
复制代码代码如下:
long_query_time =2 --是指执行超过多久的sql会被log下来,这里是2秒
log-slow-queries= /usr/local/mysql/log/slowquery.log --将查询返回较慢的语句进行记录 log-queries-not-using-indexes = nouseindex.log --就是字面意思,log下来没有使用索引的query log=mylog.log --对所有执行语句进行记录
windows下开启mysql日志:
复制代码代码如下:
log-error=
#Enter a name for the query log file. Otherwise a default name will be used. #注:(写成txt文件editplus可以及时重载,不过有时要放在C盘下editplus才可以及时重载) log= c:/mysql_query.log.txt #Enter a name for the slow query log file. Otherwise a default name will be used. log-slow-queries= #Enter a name for the update log file. Otherwise a default name will be used. log-update= #Enter a name for the binary log. Otherwise a default name will be used. log-bin= |
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....