Column not found when trying to update cross-database in mysql

I am trying to copy the contents of a column in one mysql database to an identical table in another mysql database.

I use:

UPDATE db1.table SET db1.table.name = db2.table.name, db1.table.address = db2.table.address WHERE db1.table.id = db2.table.id; 

I get error 1054: Unknown column "db2.table.id" in the "where" section.

Both tables have an identifier column, so I'm not sure why this will not work. I am registered as an administrator and have full rights to both databases.

+4
source share
1 answer
 UPDATE db1.table JOIN db2.table ON db1.table.id = db2.table.id SET db1.table.name = db2.table.name, db1.table.address = db2.table.address 
+8
source

All Articles