Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

nicholas maddren
nicholas maddren
12,793 Points

Live MySQL data updates?

Hey guys, I currently use a CSV file to update my database every 15 minutes using a cron job. This seems to be a little impractical as I really need live data and the whole CSV importing and replacing process is a little server thirsty.

Does anyone know of any methods to update a MySQL database with live data? For example let's say I have a called database1 on another server and I want to bridge any changes on database1 to my database which is named database2, how could I do this? It would need to post the changes instantly.


1 Answer

If I understand your question correctly, I believe you are asking about replication. There is some lag, but low in most cases.

Here is some links to MySQL replication resources --

http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html http://www.mysqlperformanceblog.com/2013/01/09/how-does-mysql-replication-really-work/

Hopefully this will get you started.