Compare 2 databases

I have two identical databases. abc15 and abc18. But there is one additional table in one of the database and I need to find it. I thought the next request should return it, but doesn't it show the report I am expecting.

select * from information_schema.tables as a
    left join information_schema.tables as b
        on a.TABLE_SCHEMA=b.TABLE_SCHEMA AND a.TABLE_NAME=b.TABLE_NAME
    where a.TABLE_SCHEMA = 'abc15' AND b.TABLE_SCHEMA='abc18' and
        b.TABLE_NAME IS NULL

      

+2


a source to share


2 answers


$ mysqldumpslow --database abc15 >/tmp/a
$ mysqldumpslow --database abc18 >/tmp/b
$ diff /tmp/a /tmp/b

      



+1


a source


What if database b has an additional table? Try full outer join and additional constraint at the end (OR a.TABLE_NAME IS NULL)



+3


a source







All Articles