I've got a local Drupal 6 instance that was working just fine yesterday. Today, though, I try to visit my site, let's call it http://testsite.local. On every page, including http://testsite.local/user, I get this error:
Site off-line The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.
If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.
Note that there is no MySQL error, here. There is only one page I can find that does not have this error: http://testsite.local/install.php. That page does include an error message on it:
Failed to connect to your MySQL database server. MySQL reports the following message: Connection refused.
- Are you sure you have the correct username and password?
- Are you sure that you have typed the correct database hostname?
- Are you sure that the database server is running?
For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.
However, my other local site is running just fine off the same database, and I can connect to the database using the command line. I'm pretty sure I have the correct permissions, as well, since things were working in the past:
$ mysql --host=localhost --user=testuser --password=testpassword testdb
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.5.11-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW GRANTS FOR CURRENT_USER();
+-------------------------------------------------------------------------------------------------------------------------------------+
| Grants for testuser@localhost |
+-------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'testuser'@'localhost' IDENTIFIED BY PASSWORD 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `testdb`.* TO 'testuser'@'localhost' |
+-------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.03 sec)
My settings.php
uses the same credentials:
$db_url = 'mysqli://testuser:testpassword@localhost/testdb';
I can't figure out what's wrong. Please help!
Check under the
sites
directory. A common cause of this can be a directory structure that's supposed to look like:But that got checked into a braindead SCCS (and out and back in via a braindead client) such that it treated the symlink as another directory, so now you have:
And, of course, you're probably only changing
default/settings.php
, since that's the only reasonable one to be changing when you're not running multisite. That said, the real solution here is not to fix the other settings.php or to repair the symlink, but instead to simply delete "somedomain.com"; it's not adding anything to your configuration.One other way I've seen this happen: a very, very large (500 lines or so) settings.php actually had two
$db_url
s in it. The second one, of course, "won". Talk about things you don't think to look for!You need to double-check that your server is really using this
settings.php
file.You can use
find
orlocate
if you are working in Linux environment.You can also try to rename/move the config file to another location and see if the error message changes.
This type of error is most likely a misconfiguration.
try: 'mysqladmin flush-hosts’. Also check your mysql user perms. Maybe your not allowing access to that db? Also check the firewalss between those servers.