12 messages in com.mysql.lists.mysqlRe: comparing two databases| From | Sent On | Attachments |
|---|---|---|
| Steve Buehler | 28 Sep 2006 13:06 | |
| Dan Nelson | 28 Sep 2006 13:10 | |
| John Trammell | 28 Sep 2006 13:11 | |
| Cory Robin | 28 Sep 2006 13:18 | |
| Peter Brawley | 28 Sep 2006 13:26 | |
| Dye, Aleksander | 28 Sep 2006 22:32 | |
| Martijn Tonies | 28 Sep 2006 23:35 | |
| mark addison | 29 Sep 2006 03:52 | |
| Andrew Braithwaite | 29 Sep 2006 09:34 | |
| Renito 73 | 29 Sep 2006 19:19 | |
| André Hänsel | 29 Sep 2006 19:33 | |
| Steve Buehler | 01 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.
Thanks Steve
-- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.407 / Virus Database: 268.12.9/458 - Release Date: 9/27/2006




