Remote MySQL Connection dropping constantly

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Jerpy
A regular
A regular
Posts: 37
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Jan 30, 2015 10:08 am

Remote MySQL Connection dropping constantly

Post by Jerpy »

Hi,
I am using NFO's pro webhosting plan for my website, website's MySQL, and my Gmod server's MySQL.

When using localhost, there are no issues. Connection never drops, everything is 100%. My servers on the other hand which have to connect remotely, drop connection constantly. I can screenshot proof if needed, but a majority of my addons have many issues holding/keeping a connection remotely. This proves to be true since even if I set my website's localhost connections to a remote one, it has connection problems as well and drops often. Basically anytime you remotely connect, the connection made is not good and will not hold.
I am 100% positive it is not a problem on the game server side. I have tested various ways and forms, and hosting/moving the MySQL databases hosted locally on my game server's machine. All seem to point directly to it being a remote connection issue, and I'm wondering if there is any resolution to this or anything that can be investigated. I love your guys' service and everything is great; but it's just this one little thing that causes issues in game since many things rely on a solid/steady MySQL connection.

Thanks in advance.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Remote MySQL Connection dropping constantly

Post by soja »

Can you post the specific MySQL error that is thrown when you experience the issue?
Not a NFO employee
Jerpy
A regular
A regular
Posts: 37
Joined: Fri Jan 30, 2015 10:08 am

Re: Remote MySQL Connection dropping constantly

Post by Jerpy »

soja wrote:Can you post the specific MySQL error that is thrown when you experience the issue?
Sorry, I probably should have added that.

It's error 110 in game, but for some reason some addons specify the error code differently, but say the same message.
Example:
Image
Any remote connections just downright refuse to connect on the website address, so I use the IP. This has always worked and still works, but connection drops.

"Can't connect to MySQL server on 'ip' (110)"

I've researched the "Can't connect to MySQL server on 'ip' error in many places, but all don't really answer my question.
My credentials are 100% correct, but the connection is just lost at random times, or sometimes refuses to connect but spits out error 110.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Remote MySQL Connection dropping constantly

Post by soja »

Jerpy wrote:
soja wrote:Can you post the specific MySQL error that is thrown when you experience the issue?
Sorry, I probably should have added that.

It's error 110 in game, but for some reason some addons specify the error code differently, but say the same message.
Example:
Image
Any remote connections just downright refuse to connect on the website address, so I use the IP. This has always worked and still works, but connection drops.

"Can't connect to MySQL server on 'ip' (110)"

I've researched the "Can't connect to MySQL server on 'ip' error in many places, but all don't really answer my question.
My credentials are 100% correct, but the connection is just lost at random times, or sometimes refuses to connect but spits out error 110.
Log into phpmyadmin, or the mysql cli on your web hosting package, and what is the uptime listed? In phpmyadmin it should look something like this:
Image

Does the uptime listed for MySQL correspond with the time your game servers dropped the mysql connection?
Not a NFO employee
Jerpy
A regular
A regular
Posts: 37
Joined: Fri Jan 30, 2015 10:08 am

Re: Remote MySQL Connection dropping constantly

Post by Jerpy »

soja wrote:
Jerpy wrote:
soja wrote:Can you post the specific MySQL error that is thrown when you experience the issue?
Sorry, I probably should have added that.

It's error 110 in game, but for some reason some addons specify the error code differently, but say the same message.
Example:
Image
Any remote connections just downright refuse to connect on the website address, so I use the IP. This has always worked and still works, but connection drops.

"Can't connect to MySQL server on 'ip' (110)"

I've researched the "Can't connect to MySQL server on 'ip' error in many places, but all don't really answer my question.
My credentials are 100% correct, but the connection is just lost at random times, or sometimes refuses to connect but spits out error 110.
Log into phpmyadmin, or the mysql cli on your web hosting package, and what is the uptime listed? In phpmyadmin it should look something like this:
Image

Does the uptime listed for MySQL correspond with the time your game servers dropped the mysql connection?
I'm not sure what you mean.
Do you mean if the server constantly went down, it'd drop connection?

Doesn't seem that way since I've got quite a bit of uptime here.
Image

Is that 'failed attempts' odd though? I feel like there shouldn't be that many.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Remote MySQL Connection dropping constantly

Post by soja »

Unfortunately gmod developers are pretty ameture, and plugins can accrue a lot of failed mysql logins causing them to get temporarily banned from the MySQL server. We had this issue, and our fix was to raise the maximum failed logins to something our stuff could never reach(10000). I don't know if this is possible without having full control over the MySQL server, but you could try setting "max_connect_errors=10000" to see if it helps. Setting it as a mysql query will only keep it changed for the duration the server is online though. If your game server does get banned, you can flush the list by running "FLUSH HOSTS;", and that should allow your game server to connect again.
Not a NFO employee
Jerpy
A regular
A regular
Posts: 37
Joined: Fri Jan 30, 2015 10:08 am

Re: Remote MySQL Connection dropping constantly

Post by Jerpy »

soja wrote:Unfortunately gmod developers are pretty ameture, and plugins can accrue a lot of failed mysql logins causing them to get temporarily banned from the MySQL server. We had this issue, and our fix was to raise the maximum failed logins to something our stuff could never reach(10000). I don't know if this is possible without having full control over the MySQL server, but you could try setting "max_connect_errors=10000" to see if it helps. Setting it as a mysql query will only keep it changed for the duration the server is online though. If your game server does get banned, you can flush the list by running "FLUSH HOSTS;", and that should allow your game server to connect again.
Trying to edit maximum failed logins and both FLUSH HOSTS; is access denied under NFO's hosting plan.
Also tried "SET GLOBAL max_connect_errors=10000;" and "mysqladmin flush-hosts" and "mysqld_safe --max_connect_errors=10000"
All require either a reload or super privilege.

Besides moving my databases, is there any other idea for this?
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Remote MySQL Connection dropping constantly

Post by soja »

Jerpy wrote:
soja wrote:Unfortunately gmod developers are pretty ameture, and plugins can accrue a lot of failed mysql logins causing them to get temporarily banned from the MySQL server. We had this issue, and our fix was to raise the maximum failed logins to something our stuff could never reach(10000). I don't know if this is possible without having full control over the MySQL server, but you could try setting "max_connect_errors=10000" to see if it helps. Setting it as a mysql query will only keep it changed for the duration the server is online though. If your game server does get banned, you can flush the list by running "FLUSH HOSTS;", and that should allow your game server to connect again.
Trying to edit maximum failed logins and both FLUSH HOSTS; is access denied under NFO's hosting plan.
Also tried "SET GLOBAL max_connect_errors=10000;" and "mysqladmin flush-hosts" and "mysqld_safe --max_connect_errors=10000"
All require either a reload or super privilege.

Besides moving my databases, is there any other idea for this?
You could open a ticket and try to ask if the max_connect_errors could be changed on your website VDS only.
Not a NFO employee
Post Reply