473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to maintain the MYSQL connection for the whole session.

madhoriya22
252 100+
Hi,
In my web application I am using Mysql at backend. The problem is If I leaves the application Idle for sometime the connection to Mysql automatically closes.
Is there anyway by which I can maintain the connection for whole session in Mysql.

Thanks and regards,
madhoriya
Jul 27 '07 #1
7 20948
mwasif
802 Expert 512MB
Increase mysql connection time out in php.ini, variable is mysql.connect_timeout.
Jul 27 '07 #2
madhoriya22
252 100+
Increase mysql connection time out in php.ini, variable is mysql.connect_timeout.
Hi mwasif,
I am not using php. I am using using JSP and JDBC. Is it possible through query in Mysql.

Thanks and regards,
madhoriya
Jul 27 '07 #3
mwasif
802 Expert 512MB
You can change the value in query too
connect_timeout
Use this query to see the connection timeout.
Expand|Select|Wrap|Line Numbers
  1. SHOW VARIABLES LIKE 'connect_timeout';
This query will change the connection timeout to 60 seconds, change the time according to your needs.
Expand|Select|Wrap|Line Numbers
  1. SET GLOBAL connect_timeout=60;
This value will be reset when the MySQL server will be restarted.

Your MySQL must have SUPER priviliges to perform this query.
Jul 27 '07 #4
madhoriya22
252 100+
You can change the value in query too
connect_timeout
Use this query to see the connection timeout.
Expand|Select|Wrap|Line Numbers
  1. SHOW VARIABLES LIKE 'connect_timeout';
This query will change the connection timeout to 60 seconds, change the time according to your needs.
Expand|Select|Wrap|Line Numbers
  1. SET GLOBAL connect_timeout=60;
This value will be reset when the MySQL server will be restarted.

Your MySQL must have SUPER priviliges to perform this query.
Hi mwasif,
I got it. Thanks.
The value first query is returnin is 5(min/sec i dont know).

Thanks and regards,
madhoriya
Jul 27 '07 #5
mwasif
802 Expert 512MB
The value first query is returnin is 5(min/sec i dont know).
Connection time out value is in seconds.
Jul 27 '07 #6
Greetings all,

I am a very very big Novice/Newbie to any type of scripting..

I am trying to run the SHOW query on my MySQL database but it keeps asking me to select "One" Column before the query will run...

I am not sure what to do... I need to find out the timeout on the Roster Master Module that is running on my Dragonfly CMS...

When I try to parse using the Roster Master module to the SOE guild roster's my database keeps timing out and does not allow me to pull in my guild rosters.

Any help is much appreciated.

Regards,
Aug 8 '07 #7
Greetings all,

I am a very very big Novice/Newbie to any type of scripting..

I am trying to run the SHOW query on my MySQL database but it keeps asking me to select "One" Column before the query will run...

I am not sure what to do... I need to find out the timeout on the Roster Master Module that is running on my Dragonfly CMS...

When I try to parse using the Roster Master module to the SOE guild roster's my database keeps timing out and does not allow me to pull in my guild rosters.

Any help is much appreciated.

Regards,
I was able to find the timeout it was 10... I tried the SET GLOBAL but it said that I needed Super privilege to be able to do this command... I sent an message to my host asking for their help with this part..

But, is there any other way that I can add the timeout into my MySQL database without such privileges?

Thanks,
Aug 8 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Abby | last post by:
I have an application that is written in php/mysql on a Linux platform and need to transfer hosts. This is a session based application and I don't know a lot about php/Linux/mysql, but can get by....
2
by: Jon Dellaria | last post by:
I have been using MySql as the database using JSP's and JavaBeans but recently I have wanted to start using the database connection pooling mechanism built into TomCat. I think I am having a...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
by: Sam White | last post by:
I have set up a MySQL db on one server, IIS 6.0 on another. Using Frontpage I created some forms to input data. On a test page I made, I have 4 fields. First is the ID which is autonumber (I leave...
5
by: Dominic | last post by:
My question is about how to maintain view state in mobile ASP.NET across postback / request in a web farm environment. First of all, let's assume the web-farm does NOT use stick-session feature....
6
by: webonomic | last post by:
"The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty." I get the error above. It tells me the error is in Line 120: ...
7
by: Martien van Wanrooij | last post by:
I have been faced a couple of times with the situation that I wanted to write a script and was worried about a too frequent opening and closing mysql connections. To give some examples: 1)I...
13
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.