MySQLdb problems with named pipe connection on Windows 7?

J

John Nagle

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.C:\python26\lib\site-packages\MySQLdb\__init__.py:34:
DeprecationWarning: the sets module is deprecated
from sets import ImmutableSetTraceback (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
 
D

Dennis Lee Bieber

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?
I wouldn't be a tad surprised if M$ Win7 has implemented some
security/privilege scheme on named pipes such that cross process/user
access is blocked.

A quick Google shows that a similar problem crops up for users of M$
SQL Server
 
J

John Nagle

I wouldn't be a tad surprised if M$ Win7 has implemented some
security/privilege scheme on named pipes such that cross process/user
access is blocked.

The MySQL command line client can connect with the same privileges.
So that may not be the problem.

John Nagle
 
J

John Nagle

I reconfigured MySQL to allow local network connections, and
now MySQLdb works over TCP. It doesn't seem to be able to use
Windows 7 named pipes, although the "mysql" command line client can.
There may be a bug. This wouldn't be noticed unless MySQL
was configured without network connections, which is rare. I set
up MySQL that way on a development machine with a local MySQL instance.

John Nagle
 
D

Dennis Lee Bieber

The MySQL command line client can connect with the same privileges.
So that may not be the problem.
Was that client built with the exact same configuration as the
MySQLdb adapter?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top