System: Mac OS X Server 10.6.latest
I just switched from the ancient MySQL (<5?) that came with Mac OS X Server to MariaDB 10.1, installed via MacPorts. (That was a whole 'nuther barrel of fun...)
Now I'm having trouble accessing the database via localhost, but only in some situations. PhpMyAdmin works with only "localhost" in the config.inc.php, but several MediaWiki instances I have running require the whole socket name in LocalSettings.php, such as "localhost:/opt/local/var/run/mariadb-10.1/mysqld.sock".
I have the socket named in my.cnf, and in three places in php.ini for the three different MySQL glue libraries available. I restarted Apache and mysqld to get them to read the changes. So I'm thinking localhost should be ubiquitous now.
I've patched around the problem by putting the socket name after "localhost" on the MediaWiki sites, but I know this is going to come back to bite me in the butt someday if I don't fix it properly.
Any thoughts on what's going on here?
Presumably both PhpMyAdmin and MediaWiki are on the same machine and that's the same machine as the MariaDB server? If so, there's no reason why one should work and not the other if they have the same settings.
Ensure you are using the same port when both are specified as just
localhost
?If you are not using the same mysql user for the login in both applications, please ensure that the host values for those users are the same.