Console as a server to implement. Here I'm taking the process I do share a
, there are wrong places, to each netizen pointed out.
System: CentOS Linux Server a ip:192.168.0.8 windows2003 suit
A ip:192.168.0.9 of the service machine
Software: CentOS Linux Server installs a mysql-server5.0 windows2003
Install a call Apmserv software with a mysql5.1,phpmyadmin (graphics
Manage MySQL database)
First, in the main service to create a user, used to synchronize the data used, I am here to pick
Use a graph to manage MySQL database software to build (phpMyAdmin)
Note here: This user admin rights must have replicaiion
slave is both a replication privilege:
Two, I use in the windows2003 from the server to use the newly built user admin whether can
Connect to Linux (main service) Apmserv Usage I don't give a detailed description here.
Running from server: Mysql-h 192.168.0.8-u admin-p and then input password
( note : Because in MySQL this is destined to be in the WinDOS system is not, so add an environment variable)
Third, configure the master server profile: vim/etc/my.cnf
(This indicates a successful primary server configuration)
Four, from the server configuration file is also my.cnf
server-id=2 from the server ID number
Master-host Home Server Address
Master-user the user name required for replication
Master-password the password for the user name you want to copy
REPLICATE-DO-DB the database you want to replicate
and restart the database.
Mysql>show slave statusg;
The
master-slave server creates a new test1 database, where data from the primary server can be plugged in from the server. * The primary server IP address changes from the server. It is no use to change the/ETC/MY.CNF only to implement synchronization. The following command is required:
stop SLAVE; reset slave; Change Master to master_host= ' master_ip ', -> master_user= ' replication_user_name ', -> master_ Password= ' Replication_password ', -> master_log_file= ' recorded_log_file_name ', -> MASTER_LOG_POS= Recorded_log_position; Start slave; The |
Replaces the Master_ip,master_user,master_password as the master IP address, the user with replication permissions, and the password
Recor Ded_log_file_name replaced by the File,recorded_log_position recorded above for the position