My site thinks it's a new install I had an error (related to Date module I think? Can't remember.) on my site so I tried to do an update. Caused a WSOD so I svn reverted. Didn't help. Manually disabled each module in the database. Didn't help. Fixed some permissions. Helped... sort of. 

Now I get this:


  Drupal already installed To start over, you must empty your existing
  database. To install to a different database, edit the appropriate
  settings.php file in the sites folder. To upgrade an existing
  installation, proceed to the update script. View your existing site.


Running the upgrade script gives this error:


  PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL
  server through socket '/var/lib/mysql/mysql.sock' (2) in
  drupal_get_installed_schema_version() (line 150 of
  /public_html/includes/install.inc).


Any other page redirects back to install.php.

So it seems like it can see the database to know that it's not empty, but can't really connect to it... what does this mean? What do I do about it.
I figured this out. It's able to see the settings.php file but instead of the right database credentials it was showing this:

$db_url = 'mysqli://mynamedrupal:xxxxxxxxxxx@localhost/myname-drupal-6';


That's goofy! I'm not even using Drupal 6! There wasn't any updated version of this later in the file; this was the only database connection info. It makes sense that this was in here, since it was originally a D6 site that I upgraded, but it's unusual that it worked so long without an updated array of DB connection info. 

So I pasted this in from another D7 install and changed the un/pw accordingly:

$databases = array (
  'default' =&gt;
  array (
    'default' =&gt;
    array (
      'database' =&gt; 'myname-drupal',
      'username' =&gt; 'myname',
      'password' =&gt; 'xxxxxxxxx',
      'host' =&gt; 'server.host.com',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
);


I can't say for sure if this works because now I'm having different, unrelated problems. But I think this solved this particular issue, as far as I can tell, and now I'm on to troubleshooting the next thing. w00t.