首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误: MySQL_python:不支持线程间共享连接

错误: MySQL_python:不支持线程间共享连接
EN

Stack Overflow用户
提问于 2014-01-15 12:17:37
回答 1查看 86关注 0票数 0

我是Python的新手,我需要运行我的rails项目,它依赖于Python应用程序。我在Mysql中使用Python并尝试运行服务器,但它引发了一个错误:

代码语言:javascript
复制
17:41:41 affiliates.1 | /home/jayashri/homebrew/izea-exchange-master/affiliates/plugins/antipool.py:477: UserWarning: Warning: Your DBAPI module '<module 'MySQLdb' from '/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b4-py2.7-linux-x86_64.egg/MySQLdb/__init__.pyc'>' does not support sharing connections between threads.
17:41:41 affiliates.1 |   "connections between threads." % str(dbapi))
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGHUP.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGTERM.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Listening for SIGUSR1.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Bus STARTING
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE PID 22407 written to './affiliates_dev.pid'.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Started monitor thread '_TimeoutMonitor'.
17:41:41 affiliates.1 | [15/Jan/2014:17:41:41] ENGINE Started monitor thread 'Autoreloader'.
17:41:42 lucre.1      | => Booting WEBrick
17:41:42 lucre.1      | => Rails 2.3.15 application starting 

17:41:46 affiliates.1 | [15/Jan/2014:17:41:46] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x1470f50>>
17:41:46 affiliates.1 | Traceback (most recent call last):
17:41:46 affiliates.1 |   File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/wspbus.py", line 147, in publish
17:41:46 affiliates.1 |     output.append(listener(*args, **kwargs))
17:41:46 affiliates.1 |   File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/_cpserver.py", line 90, in start
17:41:46 affiliates.1 |     ServerAdapter.start(self)
17:41:46 affiliates.1 |   File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/servers.py", line 53, in start
17:41:46 affiliates.1 |     wait_for_free_port(*self.bind_addr)
17:41:46 affiliates.1 |   File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/servers.py", line 251, in wait_for_free_port
17:41:46 affiliates.1 |     raise IOError("Port %r not free on %r" % (port, host))
17:41:46 affiliates.1 | IOError: Port 7180 not free on '0.0.0.0'
17:41:46 affiliates.1 | 
17:41:46 affiliates.1 | [15/Jan/2014:17:41:46] ENGINE Shutting down due to error in start listener:
17:41:46 affiliates.1 | Traceback (most recent call last):
17:41:46 affiliates.1 |   File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.1.2-py2.7.egg/cherrypy/process/wspbus.py", line 184, in start
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-15 14:16:25

twil是对的--每个python应用程序都需要一个不同的端口。如果您作为root用户在linux上运行此命令(它将告诉您其他python应用程序正在运行)

代码语言:javascript
复制
ps -ef | grep python

找到这些应用程序正在运行的端口,然后选择另一个端口。您可以使用该端口使用其他非python应用程序。如果那样的话你应该看看是什么用的端口..。

Guide/s1-server-ports.html

希望这能有所帮助!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21137230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档