MySQLdb problems with named pipe connection on Windows 7?

Discussion in 'Python' started by John Nagle, Jun 10, 2010.

  1. John Nagle

    John Nagle Guest

    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
     
    John Nagle, Jun 10, 2010
    #1
    1. Advertising

  2. On Thu, 10 Jun 2010 14:15:21 -0700, John Nagle <>
    declaimed the following in gmane.comp.python.general:


    > 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
    --
    Wulfraed Dennis Lee Bieber AF6VN
    HTTP://wlfraed.home.netcom.com/
     
    Dennis Lee Bieber, Jun 11, 2010
    #2
    1. Advertising

  3. John Nagle

    John Nagle Guest

    On 6/10/2010 11:58 PM, Dennis Lee Bieber wrote:
    > On Thu, 10 Jun 2010 14:15:21 -0700, John Nagle<>
    > declaimed the following in gmane.comp.python.general:
    >
    >
    >> 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.


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

    John Nagle
     
    John Nagle, Jun 11, 2010
    #3
  4. John Nagle

    John Nagle Guest

    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

    On 6/11/2010 9:32 AM, John Nagle wrote:
    > On 6/10/2010 11:58 PM, Dennis Lee Bieber wrote:
    >> On Thu, 10 Jun 2010 14:15:21 -0700, John Nagle<>
    >> declaimed the following in gmane.comp.python.general:
    >>
    >>
    >>> 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.

    >
    > The MySQL command line client can connect with the same privileges.
    > So that may not be the problem.
    >
    > John Nagle
     
    John Nagle, Jun 11, 2010
    #4
  5. On Fri, 11 Jun 2010 09:32:54 -0700, John Nagle <>
    declaimed the following in gmane.comp.python.general:

    > 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?
    --
    Wulfraed Dennis Lee Bieber AF6VN
    HTTP://wlfraed.home.netcom.com/
     
    Dennis Lee Bieber, Jun 12, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruintje Beer

    named pipe in java

    Bruintje Beer, Sep 27, 2005, in forum: Java
    Replies:
    2
    Views:
    9,165
    Roedy Green
    Sep 27, 2005
  2. lee, wonsun
    Replies:
    1
    Views:
    506
    Jack Klein
    Nov 2, 2004
  3. Gabriel Genellina

    Re: ImportError: No module named MySQLdb

    Gabriel Genellina, Apr 8, 2008, in forum: Python
    Replies:
    0
    Views:
    462
    Gabriel Genellina
    Apr 8, 2008
  4. Sam
    Replies:
    0
    Views:
    1,764
  5. Replies:
    1
    Views:
    250
    Ben Morrow
    Jun 2, 2004
Loading...

Share This Page