Same MySQL database on two different computers

Hi Experts

Is there a way that I can 'sync' copies of a MySQL db between two different computers?

I have a desktop and laptop (both running Windows 7, MySQL Server 5.5 and PHP and IIS) and in the main, I do stuff on my desktop but there are times when I use the laptop, which is why I need to sync the one database between the two machines.

Any ideas?

Martin CotterillDabblerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's pretty straight forward with master and slave databases,
step by step guide can be found here:
Martin CotterillDabblerAuthor Commented:
Thanks for the reply Ss.

Please tell me there's an easier way...

What's the reasoning behind not being able to make a direct copy of the data directory from one machine to the data directory on the other?

I'm new to all this you see.

I was thinking that you need automatic live 'sync' between two machines, and therefore you need one master database and other slave, but if you want transfer data from one database to another each time you move from one machine to another, you can use MySQL Workbench. It's free software can be installed on Win7 as well.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
theGhost_k8Database ConsultantCommented:
ofcourse you will have to dump and restore the database.
The easiest way for you is:
- make sure you have same mysql-config on both laptop and desktop
- Stop mysql server on desktop
- Sto mysql server on laptop
- copy mysql data directory from laptop to desktop data directory location

Better is using mysqldump:
mysqldump -uUSER -pPASSWORD --databases DBNAME > dbname.sql
copy file to laptop
mysql -uUSER -pPASSWORD < dbname.sql
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.