It’s too bad the MySQL documentation reads like a drunken rant channeled in English through Leo Tolstoy reincarnated as a database geek, otherwise I might be more familiar with nice features such as
CREATE TABLE IF NOT EXISTS database_b.my_table SELECT * FROM database_a.my_table
which quickly copies my_table
form database_a
to database_b
however given that it’s virtually impossible to read the MySQL documentation and because I cringe in horror whenever a MySQL doc page comes up in a Google search, especially since any search for anything MySQL related always results in a deluge of of links pointing into the inscrutable mess that passes for the MySQL reference site, I suppose I will forever be pining for a switch to PostgreSQL or, at the very least, not be be surprised when Oracle starts to charge exorbitant sums for consultants who are able to translate the MySQL documentation from neo-Leo Tolstoy techno-babble into succinct technical English.
Less Snarky Update
The above seems to behave differently on Windows than it does on Linux. On Windows it will not copy data if the table already exists, the preferred behavior in my opininon. On Linux it will copy (and potentially duplicate) data.