tags:

views:

251

answers:

5

Hi,

I've been developing an application on my desktop that uses MySQL. However, I travel to and from different locations all the time and I'd like to develop on my laptop.

Is there a way I can continue to develop without leaving on my desktop turned on and connecting in remotely?

A: 

Can't you just install MySQL on your laptop?

Clearly you won't be able to connect to your desktop if it's not on.

Ben Alpert
I realize that but If I make changes to the tables I'd want that reflected on my desktop. I use SVN so how would I incorporate this?
Vince
A: 

I'm running MySQL (and pg) on a netbook. No problem with tables with under about 1 million rows.

tpdi
A: 

You could try WAMP server that includes, Apache, MySQL and PHP all in one package

Ram
+1  A: 

This depends on what you really want to do.

If you just care about the table structure, your build process probably already has some .sql files that get executed to set up a new database. Just instal MySQL on your laptop, and set it up from the same .sql files. If your build process doesn't have the complete database schema in some file (version controlled, of course), that is the first step. At that point, you can make DB schema changes while disconnected, and just have to diff those .sql files to see what has changed.

If you only care about getting schema + data from the desktop to the laptop when you go offline, install MySQL on the laptop, and then follow any of the standard backup/restore procedures, backing up your desktop, and restoring on your laptop. Then each session on your laptop, you'll have the latest data and schemas from the desktop. You could reverse the process if you change the schemas or add data you care about while on the laptop.

If you are intending to sync up the data and the structure between your laptop and desktop, you might look at setting up replication. Both MySQL servers would keep logs, and when they contact each other they process the logs to reconcile differences.

And, if you don't want to bother with installing and maintaining a second instance of the database on the laptop, you might want to think about abstracting the database layer. Most languages have bindings for an in-memory database like SQLite or Hypersonic or the like. If you aren't doing incredibly complex stuff with the database that would lead to lots of vendor specific hacks, it should be easy to support one of the in-memory databases just to do some development on the laptop and have a database available. Even if you are doing complicated things, if you are using a framework, many of them support an in-memory database out of the box, if only to have something available for demos and example code.

So, it really depends on exactly what you need - anything from full two-way automated syncing to some manual, ad-hoc syncing, to just needing a database, any database available for the program to run.

ramanman
+3  A: 

Why don't you try to use XAMPP instead? I think they have portable version of it. This way, you just need to copy the whole XAMPP folder to carry it with you. I think they stored the whole thing, including the database file inside it.

Ferry