Python MySQL.connect() question

Hafeez Bana hafhat at cs.rmit.edu.au
Thu Feb 3 00:26:39 CET 2000


I am sorry. I should have explained my reason for saying so. The MySQL
interface uses "localhost" as the default value (when you supply a null
hostname) - and when localhost is used it uses a unix socket. If you
want to use TCP/IP sockets (which is more platform independent but
slower) you need to specify something other then "localhost".

Mysql can be told what kind of communication it uses. In your case Mysql
maybe listening on a unix socket and so localhost works  - this was not
the case with my configuration of Mysql. I hope you get what I am
saying.

Further information can be found in the README for the MySQL driver. I
think Jim would be the best person to confirm if it worked - it did for
me.
Hafeez



Boudewijn Rempt wrote:
> 
> Hafeez Bana <hafhat at cs.rmit.edu.au> wrote:
> 
> > Try using "127.0.0.1" instead of localhost.
> 
> Well, that shouldn't make a difference - especially since localhost
> does work on my box. I wonder what the results would be if Jim used
> another MySQL binding, like MySQLdb?
> 
> --
> 
> Boudewijn Rempt  | http://www.valdyas.org



More information about the Python-list mailing list