As shown in the OP I am already doing that in the PHP scipt:

$host = "";

And then passing that as the 1st param to mysql_connect

On 4/21/13 4:23 PM, Stuart Dallas wrote:
On 22 Apr 2013, at 00:14, Glob Design Info <> wrote:

However, I may have found the problem: the port. As a security measure the BaaS 
provider appears to have changed MySQL to a non-standard port. So............

On the command line:

sudo mysql --port=8904 --user=<realuser> 

WORKS perfectly - entering the MySQL Monitor.

However, on the same host, same command line:

sudo mysql --user=<realuser> 
The MySQL command line doesn't support putting the port number there, but the 
first parameter of mysql_connect does. If this is the problem then it cannot be 
true that replacing the variables you were taking from $_POST with literal 
strings for the username and password worked, as I asked earlier to which you 
said it does.

Replace the first parameter to your mysql_connect call with 
'' and it will probably work.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to