[python-win32] Mysqldb

Simon Dahlbacka simon.dahlbacka at gmail.com
Wed Oct 24 14:03:36 CEST 2007


What I was trying to say has actually nothing to do with python nor sql but
networking in general.

The host name 'localhost' (and IP address 127.0.0.1 for that matter) always
refers to the current machine, and if the server is running on computer a
and the client on computer b the client will always fail if you use
localhost as the host to connect to (unless computer a == computer b or
computer b has a mysql server running with the same credentials and
database)

So to have a chance of success you need to find the hostname or ip address
of computer a and replace use that info instead when connecting from the
client on computer b.

hope this helps
Simon

On 10/24/07, kNish <singhai.nish at gmail.com> wrote:
>
> Hi,
>             I must admit I know more of python than SQL. When you say not
> with localhost as hostname. You are saying that given a computer A which is
> acting as a server, has a user name created as root and passwd "", When
> another computer B on the same network, domain (without a firewall) tries to
> connect to Computer A using the command
>
> conn = MySQLdb.connect(host = "localhost",port = 3306, user =
> "root",passwd = "",db = "dailies",cursorclass=MySQLdb.cursors.DictCursor)
>
> How else will it communicate to access the records on computer A from B.
>
> BRgds,
>
> kNish
>
>
>
>
>
> On 10/24/07, kNish <singhai.nish at gmail.com> wrote:
> >
> > Hi,
> >
> >         Command in use :
> >
> > conn = MySQLdb.connect(host = "localhost",port = 3306, user =
> > "root",passwd = "",db = "dailies",cursorclass=MySQLdb.cursors.DictCursor
> > )
> >
> >           Error :
> >
> > OperationalError: (2003, "Can't connect to MySQL server on 'localhost'
> > (10061)")
> >
> >
> >           Is it possible to have MySQLdb.connect run successfully from
> > one machine to the server machine.
> >
> > This command run well from the server machine itself.
> >
> > Background premise : wamp5 on windowsxp.
> >
> > Is their a workaround for this.
> >
> > BRgds,
> >
> >
> > kNish
> >
>
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20071024/8c21e645/attachment.htm 


More information about the python-win32 mailing list