Author Topic: Export Multiple, Individual Databases?  (Read 1002 times)

0 Members and 1 Guest are viewing this topic.

Offline TechMistressTopic starter

  • Enthusiast
  • Posts: 84
  • Gender: Female
    • View Profile
Export Multiple, Individual Databases?
« on: January 26, 2010, 08:39:30 PM »
Hi all, I'm hoping there's an answer to this!

I would like to export all of my databases. In phpMyAdmin, I selected the export, then chose all of the databases and of course then chose the standard filename structure.

It exported them all in one big file. Is there a way to export them all at once, but as individual .sql files (without doing it one by one).

Thanks!

Offline jskywalker

  • Enthusiast
  • Posts: 289
  • Gender: Male
    • View Profile
Re: Export Multiple, Individual Databases?
« Reply #1 on: January 30, 2010, 09:48:53 AM »
i dont think phpMyAdmin can do this..

but

<?php
  
echo exec('mysqldump db1 >db1.sql');
  echo 
exec('mysqldump db2 >db2.sql');
?>


might do what you want (maybe you have to add username/passwords)

Offline TechMistressTopic starter

  • Enthusiast
  • Posts: 84
  • Gender: Female
    • View Profile
Re: Export Multiple, Individual Databases?
« Reply #2 on: January 30, 2010, 08:17:24 PM »
thank you, I was able to write a script to do it with your help and using mysql dump!