Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Installing a standard MediaWiki installation on a server: itwiki.ourdomain.com

Using MySQL on a different server: mysql.ourdomain.com

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 'mysql.ourdomain.com' (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 mysql.ourdomain.com

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. –  Jakobud Sep 29 '10 at 21:52

2 Answers 2

up vote 1 down vote accepted

Could be selinux preventing httpd from making the connection

share|improve this answer
    
sestatus reports disabled –  Jakobud 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. –  Jakobud Oct 20 '10 at 16:18

Do you have php-mysql installed and enabled?

share|improve this answer
    
phpinfo() says yes. –  Jakobud 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

 
discard

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.