系统是centOS5.2 + mysql5.0.45
在my.cnf里加入了log-bin但是并没有指定路径
文档上说默认情况下和数据文件存放在同一个目录,我的数据目录是/var/lib/mysql/下,但是我并没有找到日志文件,只在/var/run/mysqld/下找到了日志文件,用find命令查找也只有/var/run/mysqld/下有日志文件,其他文件夹没找到
为什么我的日志文件默认位置和文档上说的不一样?
在my.cnf里加入了log-bin但是并没有指定路径
文档上说默认情况下和数据文件存放在同一个目录,我的数据目录是/var/lib/mysql/下,但是我并没有找到日志文件,只在/var/run/mysqld/下找到了日志文件,用find命令查找也只有/var/run/mysqld/下有日志文件,其他文件夹没找到
为什么我的日志文件默认位置和文档上说的不一样?
解决方案 »
- 求教,如何关联两个表中的两条记录
- revoke create,drop,alter 失败?
- mysql简单赋值错误
- mysql table_cache的问题
- MySql中数据类型更改的一些问题
- 删除一张表中重复记录的SQL语句怎么写?(简单得分,解决即给分)
- 在大学毕业的时候,计算机专业方面应该学的“精”点好,还是学的“广”点好?
- 初级问题:怎样导入(建立?)一个mysql数据库?(已装MySql-Front)
- 两个数据源之间怎么建存储过程?
- 我的win2003服务器重启后 mysql一直连接不上 这是错误日志 谁帮我看看咋回事呢?
- 高分跪求postgresql视频教程或postgresql入门电子书。
- 为什么找不到mysql 5.0中的mysql_config文件
show variables like 'log_bin';
show variables like 'datadir';
+---------------+-----------------------------------------------+
| Variable_name | Value |
+---------------+-----------------------------------------------+
| datadir | C:\Program Files\MySQL\MySQL Server 5.1\DATA\ |
+---------------+-----------------------------------------------+
1 row in set (0.00 sec)mysql>
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
+---------------+-------+
1 row in set (0.03 sec)mysql> show variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| datadir | /var/lib/mysql/ |
+---------------+-----------------+
1 row in set (0.00 sec)
这样的话,照道理应该在datadir目录下的哦,像你这样的问题好奇怪哦
要不这样吧
你看看err错误日志是在哪?还可以试着打开“通用查询日志”(log)看看文件生成在哪吧
/var/run/mysqld/下自动生成的是bin-log.000001,bin-log.index
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysqllog-bin
log
log-slow-queries
log-warnings# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1[mysqld_safe]
log-error
pid-file=/var/run/mysqld/mysqld.pid
~
If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin.
当你未指定时,binlog 会放在 pid-file 值对应位置。
文档中也有这么一句话,就是MySQL Server Logs这一章刚开始If no file_name value is given for --log or -l, the default name is host_name.log in the data directory
这句话出现在文档中The General Query Log这一节,文档描述和我实际测试不符If no file_name value is given for --log-slow-queries, the default name is host_name-slow.log. If a file name is given, but not as an absolute path name, the server writes the file in the data directory.
这句话出现在文档The Slow Query Log这一节,也不符合不过中文翻译的确很有问题我现在觉得可能和这句话有关If no base_name value is given
不错
文档中的话
When started with the --log-bin[=base_name] option, mysqld writes a log file containing all SQL statements that update data (both DDL and DML statements). If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin. If the basename is given, but not as an absolute path name, the server writes the file in the data directory
应该理解为:如果base_name没有给出,默认为pid-file的名字后面加上-bin作为binlog的名字,如果basename给出但没有绝对路径名,binlog会放在数据文件所在目录慢查询日志同样如此
To enable the slow query log, start mysqld with the --log-slow-queries[=file_name] option. If no file_name value is given for --log-slow-queries, the default name is host_name-slow.log. If a file name is given, but not as an absolute path name, the server writes the file in the data directory. 至于通用查询日志手册中的描述
To enable the general query log, start mysqld with the --log[=file_name] or -l [file_name] option. If no file_name value is given for --log or -l, the default name is host_name.log in the data directory
这句话我估计少了一句If a file name is given, but not as an absolute path name
我看的是5.0的官方手册