[mod_python] Newbie Connection Problems

Joshua Cohen JoshC at usracmfg.com
Tue Jul 5 08:47:18 EDT 2005


Thanks for the help. It was indeed SELinux that was causing the problem. Once I disabled it, the connection worked as it should. 

Thanks Again, 


-----Original Message-----
From: Johnathan Gurley [mailto:johnathan.gurley at gmail.com]
Sent: Saturday, July 02, 2005 2:40 PM
To: Joshua Cohen
Subject: Re: [mod_python] Newbie Connection Problems


Error code 13 is "Permission denied", so you might want to try
checking the permissions of the user that is running apache.  Also,
most people who are using Fedora report that they have a lot of
general software problems due to the default permission settings of
SELinux.  If you haven't already, try disabling it and see if the
connection goes through.  I hope this helps.


Johnathan Gurley

On 7/1/05, Joshua Cohen <JoshC at usracmfg.com> wrote:
> Hi Everyone,
> I have been programming in Python for a while now but am new to the mod_python module. I am having problems connecting to a MySQL database using MySQLdb. The database is 4.0.24 and is located on a Windows 2000 server. I am running a Fedora Core 4 PC with Apache 2/Python2.4.1 I have no issues with running a simple test script against mod_python in Apache, all is well. However, when I try to import MySQLdb and create a simple database connection I receive an error
> OperationalError: (2003, "Can't connect to MySQL server on 'IPADDRESSHIDDEN' (13)")
> The code is very simple and is as follows:
> import MySQLdb
> def sql():
>      db_connection = MySQLdb.connect(host="IPADDRESS", user="user", passwd="password", db="database", port=3306)
> There is no reason for me to go further with the code since I cannot even establish an connection to the DB. If I execute the same basic lines through a prompt, I am able to connect to the DB and query without any issues.
> Any ideas what is going wrong? I've waisted away enough of my life searching google for a solution.
> Thanks,
> Josh
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list