Operating System - HP-UX
1828631 Members
8328 Online
109983 Solutions
New Discussion

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

 

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'server1.domain.com' (0) in /opt/hpws/apache32/htdocs/test.php on line 17
Could not connect: Can't connect to MySQL server on 'server1.domain.com' (0)

I and a co-worker have spent the last couple of days trying to find some information on the error above that we are seeing. I need any suggestions that anyone has to offer.

I started by installing HP-UX 11i, v2 FOE on a RP54xx PA-RISC system. I used May 2005 distribution release of the FOE and installed the defaults. Then I applied the following:

FEATURE11i_B.11.23.0507.025.depot
PHNE_33100.depot
PHSS_33389.depot
HPUXWSATW-B213-1123-32.depot
Removed the mysql application installed from the FOE
hpuxiexpress1_A.05.00-003_HP-UX_B.11.23_IA+PA.depot

Now, we have a small test script to working. If we just use mysql commands from a console, we can connect to both a local and remote databases. When we use PHP5 and try connecting, we can connect locally using either localhost or the fully qualified name. What we can’t do is connect to any remote databases. We get the error above.

PHP5 does not include, as I understand it, the mysql libraries as did the PHP4. I have searched high and low for anything that would lead me to the reason why we can’t connect to the remote databases. The installation procedure doesn’t mention anything that you have to do special with PHP5 that I can see. The fact that we can connect through PHP5 to the local database does tell us a lot. The mysql installation seems to be 100%.

Ideas? Is anyone else using apache, PHP5, mysql from the HP site and working correctly?

We really could use a helping hand here….

Thanks!
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

I have yet to upgrade and my systems are PA-RISC anyway.

But I can say that HP did do some testing before releasing the product.

Take a look at the mysql log in /var and see it there is anything more.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kent Ostby
Honored Contributor

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

Here is a link to the web page for troubleshooting that error from the mysql web site:

http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

Thanks guys, but I have already been to the website page mentioned. I have looked for any kind of log file that would show anything. The apache error log is clean. I don't know of any log file specifically for the php part.

Remember, I did say that when we use the mysql commands from a console, we can connect to both local and remote databases. It is when we are trying to do it with apache/php5 that we can only get to the local database.
Scott Nipp
Advisor

Re: Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on

I am having this exact same problem. I did not see a resolution in this thread, and would much appreciate help with a resolution.

Basically I am experiencing the same thing as described above. Installing Apache 2.0.55 with PHP 5.0.4. I have no problem with connecting to the local MySQL server, but I am unable to establish a connection to either of my remote servers. I can connect via the mysql client to the remote servers, just not via PHP.

Please help. Thanks.

Scott