12 messages in com.mysql.lists.mysqlRe: comparing two databases
FromSent OnAttachments
Steve Buehler28 Sep 2006 13:06 
Dan Nelson28 Sep 2006 13:10 
John Trammell28 Sep 2006 13:11 
Cory Robin28 Sep 2006 13:18 
Peter Brawley28 Sep 2006 13:26 
Dye, Aleksander28 Sep 2006 22:32 
Martijn Tonies28 Sep 2006 23:35 
mark addison29 Sep 2006 03:52 
Andrew Braithwaite29 Sep 2006 09:34 
Renito 7329 Sep 2006 19:19 
André Hänsel29 Sep 2006 19:33 
Steve Buehler01 Oct 2006 07:15 
Subject:Re: comparing two databases
From:Peter Brawley (pete@earthlink.net)
Date:09/28/2006 01:26:18 PM
List:com.mysql.lists.mysql

Steve

Is there a program out there that I can use to compare two databases? Just the structure, not the content.

Here is a query that you might be able to twist into giving you what you want. Given two dbs @db1 & @db2, it lists structure diffs between them:

SELECT MIN(table_name) as TableName, table_catalog,table_schema,table_name,column_name, ordinal_position,column_default,is_nullable, data_type,character_maximum_length,character_octet_length, numeric_precision,numeric_scale,character_set_name, collation_name,column_type,column_key, extra,privileges,column_comment FROM ( SELECT 'Table a' as TableName, table_catalog,table_schema,table_name,column_name, ordinal_position,column_default,is_nullable, data_type,character_maximum_length,character_octet_length, numeric_precision,numeric_scale,character_set_name, collation_name,column_type,column_key, extra,privileges,column_comment FROM information_schema.columns c1 WHERE table_schema=@db1 UNION ALL SELECT 'Table a' as TableName, table_catalog,table_schema,table_name,column_name, ordinal_position,column_default,is_nullable, data_type,character_maximum_length,character_octet_length, numeric_precision,numeric_scale,character_set_name, collation_name,column_type,column_key, extra,privileges,column_comment FROM information_schema.columns c1 WHERE table_schema=@db2 ) AS tmp GROUP BY tablename, table_catalog,table_schema,column_name, ordinal_position,column_default,is_nullable, data_type,character_maximum_length,character_octet_length, numeric_precision,numeric_scale,character_set_name, collation_name,column_type,column_key, extra,privileges,column_comment HAVING COUNT(*) = 1 ORDER BY tablename,column_name;

PB

-----

Steve Buehler wrote:

Is there a program out there that I can use to compare two databases? Just the structure, not the content.