OK, problem solved. Not sure how it happened, but the following bit of code got deleted from the wp-config.php file:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'YOUR DB NAME HERE');
For anyone having the unrelated 'error establishing a database connection', check this before panicking :)