MySQLdb problems with named pipe connection on Windows 7?

John Nagle nagle at animats.com
Thu Jun 10 17:15:21 EDT 2010


    MySQLdb won't connect to my MySQL 5.1 on on Windows 7.
This worked on Windows 2000, but of course I've had to
reinstall everything.

    The MySQL command line client, "mysql", connects
to the database without problems.

Installed:

  ActiveState Python 2.6 (Win32)
  "mysql-essential-5.1.47.win32.msi"
  "MySQL-python-1.2.2.win32.py2.6.exe"

MySQL is configured for connections over named pipes only; it's
not running as a TCP server.  Is MySQLdb trying to use TCP for a local 
connection?  The MySQLdb documentation says that connections to
"localhost" on Windows will be made over named pipes.  Does that
not work?

my.cnf reads

	skip-networking
	enable-named-pipe

	# The Pipe the MySQL Server will use
	socket=mysql

Error messages:

\python26\python
ActivePython 2.6.5.12 (ActiveState Software Inc.) based on
Python 2.6.5 (r265:79063, Mar 20 2010, 14:22:52) [MSC v.1500 32 bit 
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import MySQLdb
C:\python26\lib\site-packages\MySQLdb\__init__.py:34: 
DeprecationWarning: the sets module is deprecated
   from sets import ImmutableSet
 >>> db = MySQLdb.connect("localhost","root","????","???")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "C:\python26\lib\site-packages\MySQLdb\__init__.py", line 74, in 
Connect
     return Connection(*args, **kwargs)
   File "C:\python26\lib\site-packages\MySQLdb\connections.py", line 170,
	in __init__
     super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError:
	(2003, "Can't connect to MySQL server on 'localhost' (10061)")
 >>>

				John Nagle



More information about the Python-list mailing list