Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My application is in PHP which by default uses MySQL db. I have connected MySQL & Oracle dbs with PHP.

Now I want to move data from Oracle db into Mysql db through PHP. Is it possible to do? Is it necessary for me to somehow sync between the two databases as we need to have our backup on the Oracle db.

How do I do this with the help of PHP?

share|improve this question

How about if you export your data to an external script file using MySQL dump (you have the options of exporting only the data and not the sturcture), which can be done through PHP and you run another PHP script of load the data into Oracle using straight PHP or an oracle client.

Instead of using MySQL dump you can also generate an SQL file which contains the records which have changed

You can also schedule the jobs using Cron but the import into Oracle job should happen some time, maybe an hour or two depending on the time it takes to generate the dump file.

share|improve this answer

One way to do this would be to code it in PHP using a loop. The loop would cycle through each row of each table in the Oracle database. Each loop would execucte a MySQL query to INSERT data in the MySQL table.

If you have a few tables this might be doable, however it could be very tedious if you have a lot of tables.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.