LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2004, 05:53 PM   #1
Dark Carnival
Member
 
Registered: Jun 2003
Posts: 166

Rep: Reputation: 30
Help me (python and MySQLdb module)


Ok I run on a slackware 9.1 pc with python 2.3.3
And MySQLdb 0.92 (newest)

I try to connect to 10.0.0.4 (my local webserver running mysql 4.0.16)
I know mysql works because phpmyadmin has no troubles with running at all.

But when I run this:
#!/usr/bin/python
import MySQLdb
#connect to the database
db = MySQLdb.connect(host="10.0.0.4", port=3306, user="facepaint", passwd="xxxxxxxx", db="client_info")

I get this error:
Traceback (most recent call last):
File "./app.py", line 8, in ?
db = MySQLdb.connect(host="10.0.0.4", port=3306, user="facepaint", passwd="crl2d4lu", db="client_info")
File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line 63, in Connect
return apply(Connection, args, kwargs)
File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 115, in __init__
self._make_connection(args, kwargs2)
File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 41, in _make_connection
apply(super(ConnectionBase, self).__init__, args, kwargs)
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '10.0.0.4' (111)")

Exactly what am I doing wrong here ?
Thanks in advance!

Last edited by Dark Carnival; 04-17-2004 at 06:14 PM.
 
Old 04-20-2004, 03:18 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Is it running on same or in different computer?
 
Old 04-22-2004, 07:31 AM   #3
Dark Carnival
Member
 
Registered: Jun 2003
Posts: 166

Original Poster
Rep: Reputation: 30
It was running on a different computer. skip networking was off. I just went into phpmyadmin and found out my user weren't permitted to log in from another domain than localhost. Fixed and working now
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
no python module base.g? hcgernhardt Linux - Software 2 04-24-2018 09:03 AM
PYTHON svn module needed with Trac humbletech99 Programming 0 11-30-2005 12:01 PM
using distutils to install a python module shanenin Programming 2 11-29-2005 09:44 PM
Installing python module on webserver... = p Eleaf Linux - General 11 10-23-2005 07:07 PM
problem installing mysqldb for python ssaigol Slackware 1 06-15-2005 02:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration