Ask a Question
Advertise on boostr.in
how to copy a table from one mysql database to another mysql database using -'php,sql,mysql,linux,shell'
how to copy a table from one mysql database to another mysql database ¬†using -'php,sql,mysql,linux,shell'
I need to copy a table from one database to another. This will be a cronjob. Which one is the best way to do it? PHP script or Shell Script. The problem with PHP, both databases has different usernames and passwords so I can't do it like this.
CREATE TABLE db1.table1 SELECT * FROM db2.table1
Should I just connect first DB get all records and insert all to new database using WHILE loop or there is a better way?
I prefer a shell script to do this instead of PHP script.
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please