I have a strange problem. I am trying to write a simple php webpage on my server, but mysql_connect () does not connect to any server, local or other. Here where it is strange. If I take the same php script and run it from the command line, the script works. phpinfo () indicates that both the file (executed by apache) and the command line (executed as root) invoke the same php version, mysql loads, and php.ini the same.
In addition, I run the MediaWiki installation on the same server, and it uses the mysqld local area network and works fine, so I completely don’t understand why the code does not work. The error I get at runtime is:
Unable to connect to MySQL server on "xxx.xxx.xxx.xxx" (13)
(IP address is disabled for the privacy of the owner of the server I'm connecting to)
source
share