1

I've inherited a Drupal 6 site running on an Ubuntu 10.04.4 LTS server. I'm trying to understand the configuration of it to create a local version of it work on.

I can't figure out how the data is being accessed. The settings file shows the following:

$db_url = 'mysql://root@localhost/drupal';
$db_prefix = 'dru_';

However when I list the databases, I can't find it:

mysql -u root
mysql> show databases \g
+--------------------+
| Database           |
+--------------------+
| information_schema |
| gitpull            |
| mysql              |
+--------------------+
3 rows in set (0.01 sec)

In addition running drush status says it can't find it either.

$ drush status
SQLSTATE[42000] [1049] Unknown database 'drupal'                   [warning]

The site is up and running so it's got to have access to the database somehow.

I figure I'm in the right directory because it's defined in /etc/apache2/sites-available and /etc/apache2/sites-enabled/

Any help would be greatly appreciated.

5
  • 2
    Don't think this can be answered without actually looking into the code base of the site. But the first thing I would check if its a multisite, or is the settings.php includes another file with the db information. – Alexei Rayu Jun 1 '16 at 18:45
  • The site is up and running so it's got to have access to the database somehow. maybe try using Backup and Migrate – No Sssweat Jun 2 '16 at 0:40
  • Have you checked the profile folder? – Tony Mao Jun 2 '16 at 5:34
  • First step towards exploring is checking in settings.php file. Check there if any database is connected or not. – parth.k Jun 2 '16 at 8:10
  • @TonyMao good call there was a profile folder. @Alexei another good call, it is indeed multisite. Turns out there were a bunch of backups in non-intuitively named folders so I was looking in the wrong place. What worked was running sudo find . -name settings.php and then checking out each of the results until I found the right one. – reedbert Jun 8 '16 at 21:20
0

The hints from Tony Mao & Alexei pointed me in the right direction. It turned out there were a bunch of backups in non-intuitively named folders, so I was looking in the wrong place.

I ended up finding the right settings.php file with sudo find . -name settings.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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