Friday, May 11, 2012

Re: Problems keeping cloud and local mysql in sync

Hi Joe,

You are correct that there is a db-diff plugin, but it only compares tables - not stored procedures. Also it only compares them one by one (select one table from one schema and its 'match' from the other). This is tedious and not something that is straightforward enough to be done regularly which it probably should be for production work. 
I suppose I will just have to be more careful about the changes I make in dev and will have to deploy them to production in a more structured fashion. I can't help but worry that this is going to come back to bite me soon though. Is there any way to get a full dump of the cloud sql db? If I get this I can restore locally and use Toad - a much more professional option.

Thanks for getting back,

Anthony Nolan


On Friday, May 11, 2012 5:40:52 PM UTC+1, Joe Faith wrote:
Hi Anthony

The Squirrel SQL client includes a db-diff plugin which I believe does what you require.
There are instructions on using Cloud SQL with Squirrel here: https://developers.google.com/cloud-sql/docs/admin_tools

J

On Fri, May 11, 2012 at 7:41 AM, Anthony Nolan <anthonynolan@gmail.com> wrote:
Hi, I am developing an app which will use Google Cloud SQL(GCS) for production (hopefully). I develop on mysql locally and try to keep the 2 databases in sync by running alter scripts on 'production' once I am happy with them on dev. This is fine in so far as it goes, but I would like to do a 100% comparison between the 2 databases before I go to production. I am aware that there is no simple technique provided for this, but have tried a number of ways to make this comparison and seem to be blocked at every hands turn.
Toad for MySql does comparisons - I have not used the mysql version yet, but based on experience with the Oracle one it will probably be good. It does not however allow you to connect to a database using jdbc (the only method that I know of for GCS). If I could get this to work I would be very happy as it would represent a very simple way of syncing the 2 databases.
My next path was to get a full dump of the mysql database from the cloud, get it on to my local machine and restore it to a new database. I could use toad to compare these, but have again been blocked as the database dump provided with GCS is just tables and data. No stored procedures are provided. Stored procedure differences are one of my main areas of concern, so this is a disappointment. 
I have also tried connecting to GCS with the google provided command line too, but also to no avail. It does not appear to let me do the full db dump that I require. It looks like a simple sql command line.
I consider the ability to compare databases crucial to working with GCS going forward. It is certainly not being made easy for me :(
I would appreciate if anyone can shed any light on this. 

Thanks,

Anthony Nolan




--
Joe Faith | Product Manager | Google Cloud

No comments:

Post a Comment