How to compare two databases' altered tables - mysql

I have inserted new columns in one database, and I now want to add the same type of columns to a second database. I need to know which columns are in the first database that are not in the second. I have many tables in each database that needs column difference comparing. I searched the web and I can only find ways to see the difference of the contents of columns in two tables. I don't need to compare the contents, just different columns in all the tables in each database. Each database has the same tables.
Thanks!
I found that you can do a database dump that just has the structure from phpmyadmin.

Are you doing this manually? You could just use SHOW CREATE to see the structure of the tables, and then something like the diff command in Linux to compare them.

For a commercial product answer: I use Red Gate's SQL Compare which works great. It can compare the entire schema of two databases. It can also update your target database to match your source database.

Use redgate SQL compare to comapre schema of two tables.
sql-dbdiff works well too. Its an open source.

Related

How to find a speicifc entry in tables in a database mysql?

I have a database wordpress consisting a lot of tables. I am looking for a certain entry 20.22.31.44. What is the best way to return the table and column if this entry exists?
You can dump your database data (SQLDump) into a file and search through it's content.
You may also use a Database Management system (i.e. Workbench, PHPMyAdmin) to perform that global search for you. See related.

How to select two column from two different access 2013 database?

I have two Database for example "Database1" another is "Database2" whose location at 'Libraries\Documents' at my pc. Now I want to select one column named it "Column3" where another column "ID" of Database1 equal to Database2. So how can I write this query? And also how can I get those data from different database and same or different location of database? please explain with query example. I found it only for SQL but not for Access database 2013.
Thanks in advance.
Did you try link tables from 2nd file into 1st file?
From one Access DB file you can link tables from various data sources, including all kinds of other databases or excel, csv, xml files, and then you can treat them as "linked table",
for all the local tables and linked tables you can easily join them and build up queries.
It is one of the many handy features that i like to use MS Access for quick and easy tasks.
Hope this helps.

mysqldbcompare skip some tables

I need to compare 2 mysql databases. But i need to compare not all tables. Some tables must be skipped.
I wanted to use the tool mysqldbcompare . It looks what i need but i don't see an option to skip some tables. seems it will just compare all tables , which will not work for me (i know some tables are different, i want to skip them)
Is it possible to skip tables with this tool?
Maybe there is some alternative tool which can compare only selected tables?
In this manual there is nothing about tables skipping https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldbcompare.html

How do i dump all the tables from a single database in a sql file except for the ones mentioned?

I wanted to know if it was possible can do a db dump of all the tables in a database, but leaving a couple of tables specified on the command line. this is for mysql. i know there is one for adding specific tables on an sql, but i dont know if you can exclude specific tables. Thanks in advance.
Mysqldump has an --ignore-table option.

Tables from two different databases in a DBML?

After dragging two tables in from one database, I switch to another and drag a table in. Now I get a message if I want to replace the connection string with the new one. I want tables from multiple databases in one DBML. Is this possible?
It is entirely possible to reference multiple databases within the same DBML, PROVIDED those databases reside on the same SQL Server.
In Visual Studio, right-click on the DBML, click "Open with..." , and select XML (Text) Editor with Encoding.
You will see your first table that you dragged in looks like this:
<Table Name="dbo.MyTable1fromMyDatabase1" Member="MyTable1fromMyDatabase1">
For your tables from other databases you wish to add, enter them like this:
<Table Name="MyDatabase2.dbo.MyTable1fromMyDatabase2" Member="MyTable1fromMyDatabase2">
This will work assuming the same login works for both databases, and your LINQ expressions can now query across both databases!
I don't believe that what you're looking for is possible, since the DataContext would then not have any easy way of resolving results from two separate databases.
If you're looking to create domain objects from two separate databases, then your best bet would be to have two separate DBML's, then use a bridge (GOF) or some other related design pattern to instantiate your domain objects.
Another option is to create a server link on on database that points to the other and make aliases to the remote tables from the "local" DB. I believe then you'd be able to reference them as if they were all in the same database.
We can also create a view that queries the table in the other database. We can select, insert and update this view, which will affect the table in the other database as well.