Compare 2 Mysql Database Schemas

I have two schemas in the database about the same application (different versions)

I want to create a Delta script with differences

It has a tool in it that helps me (an open source solution should be perfect)

thanks

+3
source share
5 answers

Navicat for MySQL does this using the Structure Synchronization tool, but it is not open source ($ 179). It will compare tables showing all the differences, and also provide you with SQL to synchronize them.

30- , . Windows, Linux Mac.

+1
+1
0

.csv , , table_schema OUTFILE, .csv Beyond Compare

select 
t.TABLE_NAME,c.COLUMN_NAME,t.TABLE_TYPE,c.COLUMN_TYPE,t.ENGINE, t.VERSION, t.TABLE_COLLATION, c.ORDINAL_POSITION, c.COLUMN_DEFAULT, c.IS_NULLABLE, c.DATA_TYPE, c.CHARACTER_MAXIMUM_LENGTH, c.NUMERIC_PRECISION, c.CHARACTER_SET_NAME, c.COLLATION_NAME, c.COLUMN_KEY, c.EXTRA, c.PRIVILEGES 
from 
information_schema.columns c, information_schema.tables t where t.table_schema = **‘schema_name1’** and t.table_schema = c.table_schema and t.TABLE_NAME = c.TABLE_NAME order by 1,2 
INTO OUTFILE **'C:/ARUN/temp2/va_empty_db_2_info.csv'** FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'
0

Source: https://habr.com/ru/post/1715745/


All Articles