Synchronization of MySQL under Windows

xiaoxiao2021-03-06  101

Under Windows Mysql Data Synchronize Window Environment, if you have a My.cnf file in the root directory, you take this profile. When running mysql / bin / winmysqladmin.exe tool, the tool names the My.cnf in the root directory name Mycnf.bak. And create my.ini in the Winnt directory. The configuration file is read when the mysql server starts. So you can copy the contents in my.cnf to the My.ini file, use the My.ini file as the MYSQL server configuration file. Setting method: Settings Example Environment: Operating System: Window2003 MySQL: 4.0.4-Beta-Max-NT-log4.0.20 A 192.168.0.9 B 192.168.0.10A: Setting 1. Add a user's most synchronized user account: Grant Replication Slave on *. * to backup@'10.10.10.53 'Identified by' 1234''192.168.0.9 'identified by' 1234 '2. Add a database as a synchronous database: CREATE DATABASE BACKUPB: Setting 1. Add a user's most synchronous User account: grant replication slave on *. * To backup@'10.10.10.22 'Identified by' 1234 '192.168. 0.10'Identified by' 1234 '2. Add a database as a synchronous database: CREATE DATABASE BACKUP master: a -> Ba is modified for Master Mysql's My.ini file. Add the following configuration in the MySQLD configuration item: Server-id = 1 log-bin binlog-do-db = backup # Specify database binlog_ignore_db = mysql # specifying a database that does not require logs (all databases are separated by commas) # Settings the log-bin = c: / mysqlbak / mysqllog setting log file can be set, # where mysqllog is the name of the log file, and MySQL will establish a different extension and file named MySQLLog. Several log files. Ratify the database service. Use the show master status command to see the log situation. B Modify b Mysql's My.ini file for slave. Add the following configuration in the MySQLD configuration item: server-id = 2master-host = 192.168.0.9master-user = backup # Synchronization user account master-password = 1234 master-port = 3306 master-connection-retrY = 60 preset retry Interval 60 second replicate-do-db = backup tells slave to update only the update database for the Backup database With the SLAVE STATUS to see synchronous configuration. (Note: Linux, the configuration of the MySQL image under Solaris is the same as WIN, but the location of the option file (My.cnf) is different. Can be determined according to the installation position or according to the custom installation location, can be used as the primary server , Multiple machines (B, c ...) as a slave server, when setting up, as long as the server-id in [mysqld] in the server option file is set to 2, ***** change MySQL's largest The number of connections is in the default start option file (My.cnf) (. Win is named my.ini) under Winnt.

转载请注明原文地址:https://www.9cbs.com/read-104887.html

New Post(0)