我有一个本地mysql服务器运行在本地主机windows7上
C:\web>mysqld --console
[...]
130428 19:12:37 [Note] mysqld: ready for connections.
Version: '5.5.31-log' socket: '' port: 3306 MySQL Community Server (GPL)
如果我尝试连接mysql,我没有问题(root没有密码)
^{pr2}$但是当我试图通过MySQL-Python1.2.4连接到mysql时,这个失败了:
C:\Users\Alle>python
Python 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> MySQLdb.connect('localhost', 'root', '', 'information_schema')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\MySQLdb\__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")
这是我的conf
我受不了了,我不知道该怎么办。。如何调试这个问题并让mysql python正常工作?我需要这个给Django,所以我不能切换连接器。在
尝试
127.0.0.1
但是很可能本地主机没有正确映射,或者您可能还需要在连接中包括该端口?在相关问题 更多 >
编程相关推荐