This is on MediaWiki 1.16 (yea, I know), MariaDB 10.1.8, and MacOS X 10.6.8.
I had a database problem, and reinitialized and restored my database from a recent logical (SQL source) backup. There were no changes to any MediaWiki PHP files. The character set (UTF8) did not change.
Now, I get the infamous "[Sitename] has a problem… Can't contact the database server: Permission denied (localhost)."
The host/database/user/password info in LocalSettings.php has not changed. I can use those same credentials to access the database from various tools, such as mysql CLI client, phpMyAdmin, and Sequel Pro. And yet, MediaWiki is still unwilling to connect. I even tried tagging "?action=purge" onto the URL to rule out caching problems.
I used phpMyAdmin to re-set the login credentials to those in LocalSettings.php, thinking perhaps they hadn't been restored correctly. No luck there. The various other database clients can still get in using those same MediaWiki login credentials.
I've taken to grepping through the .php files, looking for where the login credentials are used, trying in vain to figure out why they no longer work, when they did just 24 hours ago!
I've also crawled through the MediaWiki online documentation, with no particular insight.
I'm leaning toward a MySQL User permissions problem, but I think I've ruled that out by getting in using the same credentials with other tools.
Any insight? Please show me something simple and stupid that I've been overlooking!
Jan