So the "secret" here is to first create a table of that same structure.
Fortunately, there is a *TRIVIAL* way to do that with MySQL:
And then it's easy to put the first table into that:
CREATE TABLE students_merged LIKE db1.students_contacts;
But then to put in the *second* table, you must specify *ALL* the fields *EXCEPT* the auto_increment field.
INSERT INTO students_merged
SELECT * FROM db1.students
INSERT INTO students_merged ( product_id, user_id, ...., layout )
SELECT product_id, user_id, ..., layout FROM db2.students
(1) That will give *NEW* id values to all the students from db2.students. When you don't specify the id, and that field is auto_increment, it will just assign the next number. If that's not going to work for you--if you need to retain the old id numbers for some reason--then we have to do something different.
(2) That all assumes that you do not need to worry about duplicates. If you do, we can resolve that, too. But what *constitutes* a duplicate, in your world? Can't help until you call that out in clear language.
You would need to tell us in very explicit terms.