Mysql
Replica
tion_·
þÎñÆ÷_±ÈÌØÍø Sonn Youngseductivegirl Sv Javascript:doZoom('12') Young Seductive Girl" href="http://sonn.youngseductivegirl.com/feed//sv/javascript:doZoom('12')" />
Mysql
R
tion_·
þÎñÆ÷_±ÈÌØÍø Sonn Youngseductivegirl Sv Javascript:doZoom('12') Young Seductive Girl
Mysql
R
tion_·
þÎñÆ÷_±ÈÌØÍø Sonn Youngseductivegirl Sv Javascript:doZoom('12') Young Seductive GirlMaster# pwd
/var/eyou/mysql/bin
Master#./mysql ¨Cu root ¨Cp
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT FILE ON *.* TO rep@192.168.0.244 IDENTIFIED BY ¡®eyou¡¯;
mysql> GRANT REPLICATION SLAVE ON *.* TO rep@192.168.0.244 IDENTIFIED BY ¡®eyou¡¯;
¸³Óè192.168.10.244Ò²¾ÍÊÇSlave »úÆ÷ÓÐFileȨÏÞ, Õâ¸ö4.1.12°æ¶ÔreplicationµÄȨÏÞºÃÏñ×öÁ˵÷Õû£¬Ö»¸³ÓèSlave»úÆ÷ÓÐFileȨÏÞ»¹²»ÐУ¬»¹Òª¸øËüREPLICATION SLAVEµÄȨÏ޲ſÉÒÔ¡£
È»ºó´ò°üÒª¸´ÖƵÄÊý¾Ý¿â
Master# cd var
Master# tar czvf reptest.tar.gz reptest
ÕâÑù£¬ÎÒÃǵõ½Ò»¸öreptestÊý¾Ý¿âµÄ´ò°üÎļþreptest.tar.gz
2ÉèÖÃÖ÷·þÎñÆ÷MasterµÄmy.cnf£¬Æô¶¯Mysql·þÎñ
Master# vi /etc/my.cnf
ÔÚ[mysqld]Ìí¼Ó»òÐÞ¸ÄÒÔϵÄ
[mysqld]
log-bin #´ò¿ªlogbinÑ¡ÏîÒÔÄÜдµ½slaveµÄ I/OÏß³Ì;
server-id=1 #±íʾÊDZ¾»úµÄÐòºÅΪ1,Ò»°ãÀ´½²¾ÍÊÇmasterµÄÒâ˼.
sql-bin-update-same
binlog-do-db= reptest #±íʾͬ²½reptestÊý¾Ý¿â;
È»ºó°ÑMasterÖ÷·þÎñÆ÷µÄMysqlÖØÆô¡£
Master# /var/eyou/mysql/bin/mysqladmin ¨Cu root ¨Cp shutdown
Master# /var/eyou/mysql/bin/safe_mysqld --user=mysql &
3¡¢½¨Á¢SlaveÊý¾Ý¿â
¸Õ²ÅÔÚMasterÖдò°üÁËreptest.tar.gz£¬ËüµÄ×÷ÓþÍÊÇÒªÔÚSlave»Ö¸´³ÉÒ»ÑùµÄÊý¾Ý¿â¡£ÏȰÑMaster µÄreptest.tar.gzÎļþ´«µ½Slave»úÆ÷ÖÐÈ¥¡£È»ºó
Slave# tar zxvf reptest.tar.gz -C /var/eyou/mysql/var/
4¡¢ÐÞ¸ÄSlave·þÎñÆ÷µÄmy.cnf
Slave# vi /etc/my.cnf
ÔÚ[mysqld]Ìí¼Ó»òÐÞ¸ÄÒÔϵÄ
master-host=192.168.10.217
master-user=rep
master-password=eyou
master-port=3306
server-id=2
master-connect-retry=60
replicate-do-db=reptest ¡¡¡¡¡¡[Òª¸üеÄÊý¾Ý¿â]
log-slave-updates
5¡¢É¾³ýSlave¶ËÊý¾Ý¿âĿ¼ÖеÄmaster.info
Slave# rm /var/eyou/mysql/var/master.info
6¡¢ÖØÆô¶¯SlaveµÄslave start¡£
Slave# /var/eyou/mysql/bin/mysqladmin ¨Cu root ¨Cp shutdown
Slave# /var/eyou/mysql/bin/safe_mysqld --user=mysql &
7¡¢²âÊÔ
Ïȼì²âÁ½¸öMysqlÊý¾Ý¿âÖеÄreptestÊÇ·ñÕý³£¡£
Õý³£Çé¿öÓ¦¸ÃÊÇMasterºÍSlave ÖеÄMysql ¶¼ÓÐÏàͬµÄreptest Êý¾Ý¿â£¬²¢ÇÒÀïÃæµÄÊý¾Ý¶¼Ò»Ñù¡£
È»ºó²âÊÔreplication ¹¦ÄÜÊÇ·ñÆðÓá£
ÔÚMasterÖеÄreptestÊý¾Ý¿âÌí¼ÓÒ»±ÊÊý¾Ý£º
Master# /var/eyou/mysql/bin/mysql ¨Cu root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use reptest;
Database changed
mysql> INSERT INTO rep_table VALUES ('test1', '4321', 'T',24);
Query OK, 1 row affected (0.00 sec)
mysql>
È»ºó²é¿´Slave»úÆ÷µÄreptestÊý¾Ý¿â£º
Slave#/var/eyou/mysql/bin/mysql ¨Cu root ¨Cp
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 4.1.12
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use reptest;
Database changed
mysql>select * from reptable;;
+------+------+------+------+
| id | name | sex | age |
+------+------+------+------+
e
Mysql
R
tion_·
þÎñÆ÷_±ÈÌØÍø Sonn Youngseductivegirl Sv Javascript:doZoom('12') Young Seductive Girlt j Seductive Girl
j
Mysql
R
tion_·
þÎñÆ÷_±ÈÌØÍø Sonn Youngseductivegirl Sv Javascript:doZoom('12') Young Seductive Girlq Seductive Girl