未创建 MySQL 二进制日志文件 - Windows XP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/729933/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:16:33  来源:igfitidea点击:

MySQL binary log file not being created - Windows XP

mysqlwindowsxampp

提问by Dave McLaughlin

I've installed MySQL as part of XAMPP.

我已经安装 MySQL 作为 XAMPP 的一部分。

While attempting to set up replication, I've added the following lines to c:\windows\my.ini:

在尝试设置复制时,我已将以下几行添加到 c:\windows\my.ini:

[mysqld]
log-bin=C:/mysql-bin
server-id=1

[mysqld]
log-bin=C:/mysql-bin
server-id=1

As you can see, I've specified a full path name for the logging file, so there should be no doubt about where it is. I've also used a forward slash as recommended. I've confirmed in WinMySQLadmin that my.ini is being read.

正如您所看到的,我已经为日志文件指定了一个完整的路径名,所以毫无疑问它在哪里。我也按照推荐使用了正斜杠。我已经在 WinMySQLadmin 中确认 my.ini 正在被读取。

I've run an INSERT query, and confirmed in phpMyAdmin that the table is updated. I've done a FLUSH TABLES WITH READ LOCK. At the link above, that's the recommended next step in setting up replication, but just in case output to the log file was being buffered, I hoped this would flush it. But no files of the form mysql-bin* appear anywhere on the C: drive. Can anyone help?

我运行了一个 INSERT 查询,并在 phpMyAdmin 中确认该表已更新。我做了一个带读锁的冲洗表。在上面的链接中,这是设置复制的推荐下一步,但以防万一日志文件的输出被缓冲,我希望这会刷新它。但是 mysql-bin* 形式的文件不会出现在 C: 驱动器的任何位置。任何人都可以帮忙吗?

采纳答案by Dave McLaughlin

The answer appears to lie in a hidden my.cnf file.

答案似乎在隐藏的 my.cnf 文件中。

MySQL configurations can be stored in my.ini or my.cnf, in C:\, C:\WINDOWS or the MySQL directory itself. In Windows Explorer, my.cnf appears as just plain my (even though I'm not hiding extensions for known file types). If I ask Windows to search for it, it doesn't find it (apparently it thinks .cnf files are short-cuts and ignores them). If both my.ini and my.cnf exist, the all-but-invisible my.cnf takes precedence.

MySQL 配置可以存储在 my.ini 或 my.cnf、C:\、C:\WINDOWS 或 MySQL 目录本身中。在 Windows 资源管理器中,my.cnf 显示为普通的 my(即使我没有隐藏已知文件类型的扩展名)。如果我要求 Windows 搜索它,它不会找到它(显然它认为 .cnf 文件是快捷方式并忽略它们)。如果 my.ini 和 my.cnf 都存在,则所有但不可见的 my.cnf 优先。

It doesn't help that WinMySQLadmin displays the contents of my.ini (which are ignored), but not of my.cnf (which aren't).

WinMySQLadmin 显示 my.ini 的内容(被忽略)而不是 my.cnf(不是)的内容并没有帮助。