[DB-SIG] Cannot connect to Mysql DB when I try to start a Pyhonscript from PHP page.
watson at hf.webex.com
Wed Jan 19 08:13:45 CET 2011
I added the port in code, the issue still there. BTW, this script works
fine when I run it manually in Linux server.
And it is strange that when I change "10.224.71.99" into "localhost".
The issue is gone when I use the PHP page.
From: Dieter Maurer [mailto:dieter at handshake.de]
Sent: Wednesday, January 19, 2011 2:48 PM
To: Watson Xu
Cc: db-sig at python.org
Subject: Re: [DB-SIG] Cannot connect to Mysql DB when I try to start a
Pyhonscript from PHP page.
Watson Xu wrote at 2011-1-18 10:20 +0800:
>I created a PHP page and one Python script. Please see the following in
>blue for the PHP source code and the Python script. When I launch the
>PHP page in IE to start the python script, the python script give me
>error information shown as blow, please see the following error
>information in yellow. Could you give me some suggestions for it?
>Python Script (/var/www/html/test.py):
>passwd=MySQLdbPassword, db=MydbSID, port=MydbPort)
> super(Connection, self).__init__(*args, **kwargs2)
>_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL
>server on '10.224.71.99' (13)")
Your problem is neither on the PHP nor the Python side.
Instead, it lies with the MySQL connection parameters.
Apparently, there is no MySQL at port "3306" at host "10.224.71.99"
or it refuses to speak with this client.
More information about the DB-SIG