Prev: What's the difference?
Next: simple chat server
From: John Nagle on 10 Jun 2010 17:15 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
From: John Nagle on 11 Jun 2010 12:32 On 6/10/2010 11:58 PM, Dennis Lee Bieber wrote: > On Thu, 10 Jun 2010 14:15:21 -0700, John Nagle<nagle(a)animats.com> > 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
From: John Nagle on 11 Jun 2010 13:51 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<nagle(a)animats.com> >> 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
|
Pages: 1 Prev: What's the difference? Next: simple chat server |