How to switch database in Drupal

January 22nd, 2010 by Bruce Dou Views:208

db_set_active(‘tm’);

db_set_active(‘default’);

//Add in settings.php

$db_url['default'] = ‘mysql://root@localhost/translia_test’;
$db_url['tm'] = ‘mysql://root@localhost/tm’;

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • 豆瓣
  • DZone
  • LinkedIn
  • MySpace
  • Reddit
  • RSS

Also see:

Tags: ,

Leave a Reply