Skip to content

Sorry,but issue not resolved.Error: Connection lost: The server closed the connection #1023

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

Closed
chacent opened this issue Mar 7, 2015 · 3 comments
Assignees
Labels

Comments

@chacent
Copy link

chacent commented Mar 7, 2015

#1022,
I'm not sure that you will care this issue if i conntine in last thread,so i write a new report.

you have give me two solutions,both is not useful.
the first one,recordset is very large, if i buffer it in memory ,nodejs will crash.
the last one,i had setted wait_timeout and interactive_timeout, but it isn't what i wanted.in my case it isn't useful.

i can descript it simply,
connection.connect()->
query("select * from table")//where table is very large,and record is also very large->
fetch(count)//where count is great than 0,for example 100->
sleep(ms)//ms is a long time->
fetch(count)// if last ms between 1-45000,verything is ok,but if ms great than about 50000,
error occured

@dougwilson
Copy link
Member

Please don't make new issues to continue a conversation; there is no reason you cannot just post follow ups in the previous issue. Your issue is purely due to your MySQL server configuration, rather than this module. I believe you are actually running into the net_write_timeout setting, so I was mistaken on which setting from before. Try bumping that setting to 120 or something.

Another option is that if you are not going to read fast enough to prevent your MySQL server from timing out your connection, you may want to simply make multiple queries using LIMIT instead of a single big query and trying to read it really slow.

@dougwilson dougwilson self-assigned this Mar 8, 2015
@chacent
Copy link
Author

chacent commented Mar 8, 2015

thanks, i see.
i think you are right ,i will try the first resolution.
but i don't think the twice is a good one

@dougwilson
Copy link
Member

Ok. I'm also sorry that I don't always understand what you are saying :( In the end, the issue you are having cannot be solved by this library. You have to either tweak your MySQL server settings to change the way in which you are performing your query.

You may also want to look into other node.js MySQL libraries like "mysql2" in case they behave in a way more compatible with your workflow.

dougwilson added a commit that referenced this issue Mar 8, 2015
dougwilson added a commit that referenced this issue Mar 8, 2015
seangarner pushed a commit to seangarner/node-mysql that referenced this issue May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants