简体   繁体   English

Windows Server中的MySQL主从复制

[英]MySql master slave replication in Windows Server

I was referring this link to perform MySql master slave replication for a particular mysql database in my Windows server. 我指的是链接,以对Windows服务器中的特定mysql数据库执行MySql主从复制。

Its mentioned to write the following configuration in the my.ini file. 它提到要在my.ini文件中写入以下配置。

log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=exampledb
server-id=1

Since I am using a windows server I cannot use the above path for the log-bin attribute. 由于我使用的是Windows服务器,因此无法将上述路径用于log-bin属性。 So which is the log-bin path for mysql running in a windows server? 那么,在Windows服务器中运行的mysql的日志bin路径是什么?

Thanks 谢谢

If you did not change your default data path (I am assuming this the case based on your post) then your path would look something like this 如果您没有更改默认数据路径(我根据您的帖子假设是这种情况),那么您的路径将类似于以下内容

log-bin ="C:\\ProgramData\\MySQL\\MySQL Server 5.6\\mysql-bin.log"

If you are running version 5.5 it would look like this: 如果运行的是5.5版,则它将如下所示:

log-bin="C:\ProgramData\MySQL\MySQL Server 5.5\mysql-bin.log"

The key thing to remember here is that MySQL has to have permission to write the logs to wherever you are writing them to. 这里要记住的关键是,MySQL必须具有将日志写入到您要写入日志的位置的权限。

You could even create another folder and call it log within the MySQL folder. 您甚至可以创建另一个文件夹,并将其称为MySQL文件夹中的log The path would look like this: 路径如下所示:

log-bin ="C:\\ProgramData\\MySQL\\MySQL Server 5.6\\log\\mysql-bin.log"

Just as a side note: you should really consider looking at how mysql is installed on your windows server before going into more complex things like master-slave replication... 顺便提一句:在进行更复杂的事情(例如主从复制)之前,您应该真正考虑在Windows服务器上如何安装mysql ...

For windows systems, you can use something like 对于Windows系统,您可以使用类似

log-bin = "F:/mysql/mysql-bin.log"

Which path you're using actually doesn't really matter too much, but keep in mind the MySQL needs write permissions for it. 实际上,您所使用的路径实际上并没有太大关系,但请记住,MySQL需要对其进行写权限。 Pe, for backuping reasons I'd like it to stay close to my MySQL installation data directory. Pe,出于备份原因,我希望它保持在我的MySQL安装数据目录附近。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM