LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-07-2009, 03:36 PM   #1
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Rep: Reputation: 20
PHP apps unable to contact non-local database?


I'm dealing with a site built on a RHEL5 server, MySQL 5.0.22 (yeah, I know it's old, tell Red Hat) php 5.1.6-23, Drupal 6.4

I built a VM, dumped the database from the original server, rsynced the entire /var/www/html/ from the old server to the new server, restored the database... and it worked just fine.

Now, I need to replicate this site again, but on two VMs... one for the web server, one for the database server. I thought it would be pretty straightforward to add a MySQL user on the db host that's allowed to connect from the IP of the web host, but it just... will... not... work! I can, from the shell of the web server, connect to MySQL on the remote server just fine. Both Drupal and phpMyAdmin just will not connect... phpMyAdmin says "#2003 - The server is not responding" and Drupal tells me the site is off-line. When I try to access the install.php, it says:

Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on '172.16.1.1' (13).

Please keep in mind, though, that I absolutely can connect with the 'mysql' command at the shell. It seems like there's some magic sauce that PHP is missing. I do have php-mysql installed on the web server.
 
Old 07-07-2009, 06:36 PM   #2
eth1
Member
 
Registered: May 2008
Posts: 97

Rep: Reputation: 20
The only thing that comes to mind right now is whether the MySQL Drupal connection string/settings is correct ? Apart from that, if the MySQL server at the remote location is accepting connections over TCP/IP and you have the correct MySQL credentials, then all should be good.

This may seem odd, but do you see any anomalies in the web server or PHP error_log ?
 
Old 07-08-2009, 01:38 PM   #3
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by eth1 View Post
The only thing that comes to mind right now is whether the MySQL Drupal connection string/settings is correct ? Apart from that, if the MySQL server at the remote location is accepting connections over TCP/IP and you have the correct MySQL credentials, then all should be good.
I agree. All should be good. But it isn't.

Quote:
This may seem odd, but do you see any anomalies in the web server or PHP error_log ?
Of course not. Why would anyone want to log useful information that might help someone troubleshoot a problem?

All I know is, it doesn't work, and complete silence. Nobody has the faintest idea why.

I really hate computers sometimes.
 
Old 07-13-2009, 03:44 PM   #4
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
Is there a line like "skip-networking" or "listen 127.0.0.1" in /etc/mysql/my.cnf ?

Try to comment it out and restart mysql
 
Old 07-13-2009, 06:06 PM   #5
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ricstirato View Post
Is there a line like "skip-networking" or "listen 127.0.0.1" in /etc/mysql/my.cnf ?
No.

The problem turned out to be something I should have gone for right off the bat...

Always
Blame
SELinux
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing Contact database and IMAP integration newmarket Linux - Networking 3 07-04-2006 02:26 AM
Unable to connect To Database...PostgreSQL and PHP Manashi Programming 8 04-05-2006 06:57 AM
Open Source contact details database project hamish Linux - Software 2 02-09-2005 06:18 AM
php trying to connect to local sql, error no such database feetyouwell Programming 11 02-08-2005 12:25 PM
PHP:Unable to post variables from html form to mysql database vikram_cvk Linux - Software 1 09-29-2004 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration