Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单机多进程模式下,MySQL 连接报错:通常每个套接字地址(协议/网络地址/端口)只允许使用一次 #227

Open
YufengSoft opened this issue Jul 5, 2023 · 1 comment

Comments

@YufengSoft
Copy link
Contributor

我没有使用 feapder.BatchSpider 之类的爬虫进行操作,只是写了个脚本来处理文件,手动创建 UpdateItem 对象,然后 PIPELINE.update_items 入库,单进程的情况下没有一点问题,挂了一晚上 6w 多数据也都正常入库

但是当我多开几个进程的时候,不到 5 分钟就报错了,我修改了 MySQL 连接数最大值也没用,报错内容如下:

MainThread|2023-07-04 14:01:09,577|mysqldb.py|init|line:76|ERROR|
连接失败:
ip: localhost
port: 3306
db: xxxxxx
user_name: xxxxxx
user_pass: xxxxxx
exception: (2003, "Can't connect to MySQL server on 'localhost' ([WinError 10048] 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。)")

报错的地方不固定,但都是与创建连接池有关,暂时不清楚是什么原因

@shouge
Copy link

shouge commented Mar 1, 2024

这是在Windows 系统上吧?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants