, .
, Falko Timme, , exampledb IP- 192.168.0.100 . ( ) Debian Sarge; .
, /etc/mysql/my.cnf. MySQL, MySQL IP-, ( ):
#skip-networking
#bind-address = 127.0.0.1
, MySQL, ( , , ), , , MySQL . exampledb, /etc/mysql/my.cnf:
log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=exampledb
server-id=1
MySQL:
/etc/init.d/mysql restart
MySQL root :
mysql -u root -p
Enter password:
MySQL.
GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY '<some_password>'; (Replace <some_password> with a real password!)
FLUSH PRIVILEGES;
( MySQL) :
USE exampledb;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
- :
+---------------+----------+--------------+------------------+
| File | Position | Binlog_do_db | Binlog_ignore_db |
+---------------+----------+--------------+------------------+
| mysql-bin.006 | 183 | exampledb | |
+---------------+----------+--------------+------------------+
1 row in set (0.00 sec)
, !
MySQL:
quit;
exampledb . - , - LOAD DATA FROM MASTER; . , , , , , , . , , .
, :
mysqldump -u root -p<password> --opt exampledb > exampledb.sql (Replace <password> with the real password for the MySQL user root! Important: There is no space between -p and <password>!)
SQL- exampledb exampledb.sql. !
LOAD DATA FROM MASTER; .
Finally, we need to unlock the tables in exampledb:
mysql -u root -p
Enter password:
UNLOCK TABLES;
quit;