Keanu Posted March 14, 2008 Share Posted March 14, 2008 Hey, I don't think i've posted on here before.. So Hey!... Okay, down to my problem.. I've got 2 game servers running on a VPS, that need *Constant* connection to SQL... I've hosted the SQL databases on my webserver, but every now and then the SQL database loses connection with the gameserver... What I want to know is.. Is there a way that I can keep that SQL connection *CONSTANT*... Like, never dies.. x_x;; I've got Cpanel, and access to pretty much anything... (My friends server).. So yeah... Can anyone help me out? I *need* to keep the connection between the SQL and the gameserver.exe absolutly constant, and I have no idea how i'd do that... Thanks in advance! -Keanu Quote Link to comment Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 You mean persistent? Quote Link to comment Share on other sites More sharing options...
Keanu Posted March 14, 2008 Author Share Posted March 14, 2008 persistent... Constant.. Same thing .. Yeah, pretty much.. I just need the connection so it stays alive. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 I'm not familiar with mysql_pconnect() -- a PHP function -- so you'd have to see what everyone else says. Quote Link to comment Share on other sites More sharing options...
Keanu Posted March 14, 2008 Author Share Posted March 14, 2008 Well.. Its not really php.. Its.. a exe, connecting to the database on the cpanel server.. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 14, 2008 Share Posted March 14, 2008 Hmm... you could issue a "SELECT NOW()" periodically with a background process... Quote Link to comment Share on other sites More sharing options...
Keanu Posted March 14, 2008 Author Share Posted March 14, 2008 What I was thinking of doing is starting up a cronjob every 30 secconds or so.. Then have it run a script that opens up the sql database.. If ya get what I mean? D'ya think that'd work? Thanks in advance! -Keanu Quote Link to comment Share on other sites More sharing options...
fenway Posted March 15, 2008 Share Posted March 15, 2008 That's about the same thing... 30 seconds may be a bit frequent. Quote Link to comment Share on other sites More sharing options...
aschk Posted March 17, 2008 Share Posted March 17, 2008 So hold, how are you connecting to the database exactly? And if no connection is occuring what errors are you getting back? "Too many connections" "Invalid credentials" "Memory usage exceeded" ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.