Reputation: 193
Is there a way to insert data from a table in schema1 to a table in schema2 in mysql.
Also , I assume there will be any access/privilege issues.
My environment is Joomla using Fabrik extension, PHP, MySQL
Kindly share some tips
Thanks in advance
Upvotes: 2
Views: 4008
Reputation: 9148
This query does that:
INSERT INTO db2.table1 SELECT * FROM db1.table1;
If you do this as root user, you will have no permission issues.
Upvotes: 1
Reputation: 6585
You can always preface the table name with the database name and as long as the user has the appropriate permission you can do:
insert into db1.users( first, middle, last )
select a.first, a.middle, a.last from db2.users a
See the following for the documentation insert .. select
Upvotes: 1