简体   繁体   中英

MySQL and Windows Vista: How to setup replication?

I found many links where unix system is using. Could anybody give some links for windows settings or tell me some quick start?

There are two listening addreses: 127.0.0.1/2 but mysql can connect also on 127.0.0.3 and so on. That is strange.

Thanks

In Windows, MYSQL.EXE can be called to install a windows service. The service then can be started and stopped using SERVICES.MSC or "NET START/STOP servicename". Part of the service-definition is the path to the MY.INI file that your MySQL instance is to use.

Example:

 "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install instance1 --defaults-file=c:\instance1\my.ini

In your my.ini file, you need to create a [mysqld] section, and for each instance you need to define a different port number (or ip number) to use, and a different datadir.

Example:

[mysqld]
port=3307
datadir=c:\instance1\data

You can, and should, add additional definition here, or maybe use an existing my.ini file as a base to start from. Also, you need to copy a database datadir into that datadir-location, or generate a new empty datadir using whatever method - you'll end up with c:\\instance1\\data\\mysql and the user.frm, user.MYD, user.MYI and so on files in that directories.

Start the instance using NET START instance1 or SERVICES.MSC. Check EVENTVWR.MSC for error messages if that fails.

Talk to the instance using

mysql --port=3307 --host=127.0.0.1

again avoiding the word localhost, as it has special meaning.

It is then possible to use normal Unix replication tutorials to play with replication. Make sure you are using 127.0.0.1 as a hostname ("localhost" is a magic word in the MySQL/C connector and it's derivates), and that you always also specify a proper port number.

Ok. I found out that I need different servers anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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