Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Installing a standard MediaWiki installation on a server:

Using MySQL on a different server:

I've created the user wikiuser and the schema/db: itwiki and assigned all the proper permissions, etc for the user to that schema.

During the MediaWiki installation I get the following error:

Attempting to connect to database server as wikiuser...failed with error [2003] Can't connect to MySQL server on '' (13).

I have the correct hostname, user, password and schema entered though. In order to verify my user permissions, I reverted back to the shell on the same web server:

> mysql -u wikiuser -p -h

And that allowed me to successfully connect to the database when I entered the password.

So something weird is going on here. I can connect just fine from the command line, but MW is not allowing me to connect. Any thoughts on where I should be looking to troubleshoot this behavior?

share|improve this question
It's not clear from your question but did you use the command line from the web server machine or another machine? – John Gardeniers Sep 29 '10 at 21:38
From the web server via Putty. – Jake Wilson Sep 29 '10 at 21:52
up vote 1 down vote accepted

Could be selinux preventing httpd from making the connection

share|improve this answer
sestatus reports disabled – Jake Wilson Sep 29 '10 at 21:52
SELinux was the problem. Even though it was reporting as disabled, when I looked in the Firewall config it showed SELinux still as enabled. Setting it to permissive fixed the problem. Man... Trying to troubleshoot SELinux-related problems on a server is such a pain. – Jake Wilson Oct 20 '10 at 16:18

Do you have php-mysql installed and enabled?

share|improve this answer
phpinfo() says yes. – Jake Wilson Oct 1 '10 at 3:06
You could try writing a simple PHP page that just connects to MySQL server. If this doesn't work, add debugging information, make PHP write a stack trace, etc. If the simple PHP file works then it looks like a bug in mediawiki. Maybe a specific authentication algorithm (not md5 based)? – Hubert Kario Oct 1 '10 at 23:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.