2008年01月02日 星期三 21:35
´ó¼ÒºÃ£¬ ×î½üÒªÓõ½MySQLdbÕâ¸öÄ£¿é£¬°²×°µÄʱºòûÓбà¼site.pyÕâ¸öÎļþ¡£°²×°ºÃÁËÒÔºó£¬import MySQLdbûÓб¨´í¡£µ«ÊÇ£º help(MySQLdb)µÄʱºò³öÏÖÒÔÏ´íÎó£º >>> help(MySQLdb) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site.py", line 308, in __call__ return pydoc.help(*args, **kwds) File "/usr/lib/python2.3/pydoc.py", line 1545, in __call__ self.help(request) File "/usr/lib/python2.3/pydoc.py", line 1581, in help else: doc(request, 'Help on %s:') File "/usr/lib/python2.3/pydoc.py", line 1372, in doc pager(title % desc + '\n\n' + text.document(object, name)) File "/usr/lib/python2.3/pydoc.py", line 280, in document if inspect.ismodule(object): return self.docmodule(*args) File "/usr/lib/python2.3/pydoc.py", line 970, in docmodule for file in os.listdir(object.__path__[0]): OSError: [Errno 20] Not a directory: '/usr/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-linux-i686.egg/MySQLdb' Ö´ÐÐÁ¬½ÓÃüÁîµÄʱºò ´íÎóÈçÏ£º >>> db=MySQLdb.connect(db='pcs_east') Traceback (most recent call last): File " ", line 1, in ? File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 74, in Connect File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 170, in __init__ _mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)") ÓÃphpÓïÑÔ·ÃÎÊmysqlÊý¾Ý¿âûÓгöÏÖ"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)´íÎó£¬ÇëÎÊÕâ¸öÊÇʲôÔÒò¡£ ÊÇÎÒ°²×°MySQLdbÓÐÎÊÌâÂ𣿠»¹ÓÐÒ»¸öÎÊÌ⣬°²×°µÚÈý·½Ä£¿éÊÇÓÃpython setup.py build£¬python setup.py install¡£Èç¹ûҪжÔØÒѾ°²×°µÄÄ£¿é ÐèÒªÈçºÎ×ö£¿ лл´ó¼ÒÁË¡£ 2008-01-02 ZhangRuirui -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080102/b0fbe246/attachment-0001.html
2008年01月02日 星期三 21:52
ºÃÏñûÓÐÅäÖÃsite.py£¬MySQLdb×°ÉϾÍÖ±½ÓºÃÓÃÁË¡£ ²»¹ýÎÒÊÇÔÚwindowsÉÏʹÓõÄMySQLdb¡£ жÔØmoduleµÄ»°£¬¾ÍÖ±½ÓÔÚsite-packagesÏÂɾ³ý¶ÔÓ¦µÄÎļþ¾ÍºÃÁË°É ÔÚ08-1-2£¬ZhangRuirui <rrzhang在ipp.ac.cn> дµÀ£º > > ´ó¼ÒºÃ£¬ > ×î½üÒªÓõ½MySQLdbÕâ¸öÄ£¿é£¬°²×°µÄʱºòûÓбà¼site.pyÕâ¸öÎļþ¡£°²×°ºÃÁËÒÔºó£¬import MySQLdbûÓб¨´í¡£µ«ÊÇ£º > help(MySQLdb)µÄʱºò³öÏÖÒÔÏ´íÎó£º > >>> help(MySQLdb) > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site.py", line 308, in __call__ > return pydoc.help(*args, **kwds) > File "/usr/lib/python2.3/pydoc.py", line 1545, in __call__ > self.help(request) > File "/usr/lib/python2.3/pydoc.py", line 1581, in help > else: doc(request, 'Help on %s:') > File "/usr/lib/python2.3/pydoc.py", line 1372, in doc > pager(title % desc + '\n\n' + text.document(object, name)) > File "/usr/lib/python2.3/pydoc.py", line 280, in document > if inspect.ismodule(object): return self.docmodule(*args) > File "/usr/lib/python2.3/pydoc.py", line 970, in docmodule > for file in os.listdir(object.__path__[0]): > OSError: [Errno 20] Not a directory: > '/usr/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-linux-i686.egg > /MySQLdb' > > Ö´ÐÐÁ¬½ÓÃüÁîµÄʱºò ´íÎóÈçÏ£º > >>> db=MySQLdb.connect(db='pcs_east') > Traceback (most recent call last): > File "", line 1, in ? > File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 74, in > Connect > File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 170, in > __init__ > _mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL > server through socket '/var/lib/mysql/mysql.sock' (111)") > > ÓÃphpÓïÑÔ·ÃÎÊmysqlÊý¾Ý¿âûÓгöÏÖ"Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' (111)´íÎó£¬ÇëÎÊÕâ¸öÊÇʲôÔÒò¡£ > ÊÇÎÒ°²×°MySQLdbÓÐÎÊÌâÂ𣿠> > »¹ÓÐÒ»¸öÎÊÌ⣬°²×°µÚÈý·½Ä£¿éÊÇÓÃpython setup.py build£¬python setup.py install¡£Èç¹ûҪжÔØÒѾ°²×°µÄÄ£¿é > ÐèÒªÈçºÎ×ö£¿ > лл´ó¼ÒÁË¡£ > > > 2008-01-02 > ------------------------------ > ZhangRuirui > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20080102/d904e1a1/attachment.htm
Zeuux © 2024
京ICP备05028076号