diff --git a/includes/destinations.db.mysql.inc b/includes/destinations.db.mysql.inc
index 019da7b..41826e5 100644
--- a/includes/destinations.db.mysql.inc
+++ b/includes/destinations.db.mysql.inc
@@ -45,25 +45,34 @@ class backup_migrate_destination_db_mysql extends backup_migrate_destination_db
     $out = array();
     global $databases;
     foreach ((array)$databases as $db_key => $target) {
-      foreach ((array)$target as $tgt_key => $info) {
+      foreach ((array)$target as $tgt_key => $infos) {
         // Only mysql/mysqli supported by this destination.
-        $key = $db_key . ':' . $tgt_key;
-        if ($info['driver'] === 'mysql') {
-          $url = $info['driver'] . '://' . $info['username'] . ':' . $info['password'] . '@' . $info['host'] . (isset($info['port']) ? ':' . $info['port'] : '') . '/' . $info['database'];
-          if ($destination = backup_migrate_create_destination('mysql', array('url' => $url))) {
-            // Treat the default database differently because it is probably the only one available.
-            if ($key == 'default:default') {
-              $destination->set_id('db');
-              $destination->set_name(t('Default Database'));
-              // Dissalow backing up to the default database because that's confusing and potentially dangerous.
-              $destination->remove_op('scheduled backup');
-              $destination->remove_op('manual backup');
-            }
-            else {
-              $destination->set_id('db:'. $key);
-              $destination->set_name($key .": ". $destination->get_display_location());
+        $outer_key = $db_key . ':' . $tgt_key;
+
+        // Take multiple definitions per target into account.
+        if (!empty($infos['driver'])) {
+          $infos = array($infos);
+        }
+
+        foreach ($infos as $idx_key => $info) {
+          $key = $outer_key . ':' . $idx_key;
+          if ($info['driver'] === 'mysql') {
+            $url = $info['driver'] . '://' . $info['username'] . ':' . $info['password'] . '@' . $info['host'] . (isset($info['port']) ? ':' . $info['port'] : '') . '/' . $info['database'];
+            if ($destination = backup_migrate_create_destination('mysql', array('url' => $url))) {
+              // Treat the default database differently because it is probably the only one available.
+              if ($outer_key == 'default:default') {
+                $destination->set_id('db');
+                $destination->set_name(t('Default Database'));
+                // Dissalow backing up to the default database because that's confusing and potentially dangerous.
+                $destination->remove_op('scheduled backup');
+                $destination->remove_op('manual backup');
+              }
+              else {
+                $destination->set_id('db:'. $key);
+                $destination->set_name($key .": ". $destination->get_display_location());
+              }
+              $out[$destination->get_id()] = $destination;
             }
-            $out[$destination->get_id()] = $destination;
           }
         }
       }
