Your SlideShare is downloading. ×
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Mysql data replication
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mysql data replication

1,035

Published on

This is my first slide.

This is my first slide.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,035
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
49
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Server-id = 0  master refuses connections from all slaves.Optimize for InnoDByou should use innodb_flush_log_at_trx_commit=1 and sync_binlog=1 in the master my.cnf file.Turn off firewall to make sure can connect mysql of other machine
  • In My.inimaster-connect-retry=60replicate-do-db=exampledb
  • Multi master for master overload
  • Transcript

    • 1. Ngô Anh TuấnDeveloper at Webtretho
    • 2. » What is My SQL Data Replication?» Why we use?» Setup on Master» Setup on Slave» Code Example» Other Replication» Q&A
    • 3. » Replication.» Asynchronous data from Master to Slave.» Master – Can Read and Write.» Slave – Only Read.
    • 4. » Database server is overloaded.» Security.» A solution for backup.
    • 5. » My.cnf (Linux) or My.ini (Windows)» Don’t use skip-networking param.» Enable binary log for mysql log-bin=mysql-bin binlog_format=mixed (recommend)» Set server ID server-id=1» Create user for replication (optional) CREATE USER replication_user@%; GRANT REPLICATION SLAVE , REPLICATION CLIENT ON * . * TO replication_user@%;
    • 6. » My.cnf (Linux) or My.ini (Win)» Set server ID server-id=2» Go to mysql from command line CHANGE MASTER TO MASTER_HOST=’192.168.2.248′, MASTER_PORT=3306, MASTER_USER=’replication_user’, MASTER_PASSWORD=’PASSWORD’;» START SLAVE;» SHOW SLAVE STATUS G;
    • 7. » Read more: http://dev.mysql.com/doc/refman/5.5/en/repli cation-howto.html http://www.jamiehurst.co.uk/mysql-tutorial- replication/
    • 8. DEMO
    • 9. » Config.php.» Example.php.» Using adodb.
    • 10. » Multi Master Replication http://mysql-mmm.org/» My SQL proxy http://dev.mysql.com/downloads/mysql-proxy/» My SQL Cluster http://dev.mysql.com/doc/index-cluster.html
    • 11. Q&A
    • 12. Thank you!

    ×