Connecting Tech Pros Worldwide Forums | Help | Site Map

How do i change max_connections and wait_timeout variables globally (for good)

Sami
Guest
 
Posts: n/a
#1: Jul 20 '05
I keep getting the famous 'Too Many Connection' Error, and don't know
how to change my variables, so they persist even if i have to restart
mysql service.

Platform: Windows 2003 Server
My Program is a WebApplication that is written in VB.Net
Using ODBC and OLEDB to connect <- (don't blame me, i just took this
over)

From what i have read so far, the problem is that i need to change
some settings to prevent my connections from being open for the
default of 8 hours.

So I am trying to change the following setting once and for all to:
max_connections=300
wait_timeout=2

(I'm not 100% sure that this is enough, but i guess i have to play
with these settings to find the right balance. We currently only have
about 400 Hits per day. Each Page is making about 1-4 calls to the
MySQL DB)

Now, if i restart the MySql Service, I don't want to have change this
again through script or whatever. I already changed the values
(actually added them) to the my.ini file, and i could not find a
my.cnf file at all.

So, is there one place that i can make this change for good? or is
there a certain syntax that i need to use? Could you please give me
some high-level instructions?

What i do know: --------------------------------------------------------------
-I do know that i would need to log on as root, and make this change.
-I do know that the service reads its values from my.ini - and
supposedly uses any overrides from a my.cnf file. (I was not able to
find the my.cnf file)
-I do have the latest (4.0) version of MySql on the server.

What i tried already:
1. I added 2 lines to the my.ini file
max_connections=300
wait_timeout=2

2. I logged on as root and ran:
SET GLOBAL max_connections=300
SET GLOBAL wait_timeout=2
Then i ran the mysqladmin.exe and created the Report of the variables:
The Report states that i got
max_connections 100
wait_timeout 28800
(Grrr!)

Also, I cannot make drastic programming or connection changes in code
because i am in the process to move the data layer over to SQL Server
2000.

Sorry for being ignorant here, i have taken this project over and am
no expert on mysql.

Please help if you have any basic instructions.

steve
Guest
 
Posts: n/a
#2: Jul 20 '05

re: How do i change max_connections and wait_timeout variables globally (for good)


Sami2 wrote:[color=blue]
> I keep getting the famous ’Too Many Connection’ Error, and
> don’t know
> how to change my variables, so they persist even if i have to[/color]
restart[color=blue]
> mysql service.
>
> Platform: Windows 2003 Server
> My Program is a WebApplication that is written in VB.Net
> Using ODBC and OLEDB to connect <- (don’t blame me, i just
> took this
> over)
>
> From what i have read so far, the problem is that i need to change
> some settings to prevent my connections from being open for the
> default of 8 hours.
>
> So I am trying to change the following setting once and for all to:
> max_connections=300
> wait_timeout=2
>
> (I’m not 100% sure that this is enough, but i guess i have to
> play
> with these settings to find the right balance. We currently only[/color]
have[color=blue]
> about 400 Hits per day. Each Page is making about 1-4 calls to the
> MySQL DB)
>
> Now, if i restart the MySql Service, I don’t want to have change
> this
> again through script or whatever. I already changed the values
> (actually added them) to the my.ini file, and i could not find a
> my.cnf file at all.
>
> So, is there one place that i can make this change for good? or is
> there a certain syntax that i need to use? Could you please give me
> some high-level instructions?
>
> What i do know:
> --------------------------------------------------------------
> -I do know that i would need to log on as root, and make this[/color]
change.[color=blue]
> -I do know that the service reads its values from my.ini - and
> supposedly uses any overrides from a my.cnf file. (I was not able[/color]
to[color=blue]
> find the my.cnf file)
> -I do have the latest (4.0) version of MySql on the server.
>
> What i tried already:
> 1. I added 2 lines to the my.ini file
> max_connections=300
> wait_timeout=2
>
> 2. I logged on as root and ran:
> SET GLOBAL max_connections=300
> SET GLOBAL wait_timeout=2
> Then i ran the mysqladmin.exe and created the Report of the[/color]
variables:[color=blue]
> The Report states that i got
> max_connections 100
> wait_timeout 28800
> (Grrr!)
>
> Also, I cannot make drastic programming or connection changes in[/color]
code[color=blue]
> because i am in the process to move the data layer over to SQL[/color]
Server[color=blue]
> 2000.
>
> Sorry for being ignorant here, i have taken this project over and[/color]
am[color=blue]
> no expert on mysql.
>
> Please help if you have any basic instructions.[/color]

On Windows, you change the "ini" settings thru winmysqladmin
graphical interface. Open it up, and there is a tab for changing ini
settings. Restart the server and you should be ok.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/mySQL-change...ict129017.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=433118
steve
Guest
 
Posts: n/a
#3: Jul 20 '05

re: How do i change max_connections and wait_timeout variables globally (for good)


Sami2 wrote:[color=blue]
> I keep getting the famous ’Too Many Connection’ Error, and
> don’t know
> how to change my variables, so they persist even if i have to[/color]
restart[color=blue]
> mysql service.
>
> Platform: Windows 2003 Server
> My Program is a WebApplication that is written in VB.Net
> Using ODBC and OLEDB to connect <- (don’t blame me, i just
> took this
> over)
>
> From what i have read so far, the problem is that i need to change
> some settings to prevent my connections from being open for the
> default of 8 hours.
>
> So I am trying to change the following setting once and for all to:
> max_connections=300
> wait_timeout=2
>
> (I’m not 100% sure that this is enough, but i guess i have to
> play
> with these settings to find the right balance. We currently only[/color]
have[color=blue]
> about 400 Hits per day. Each Page is making about 1-4 calls to the
> MySQL DB)
>
> Now, if i restart the MySql Service, I don’t want to have change
> this
> again through script or whatever. I already changed the values
> (actually added them) to the my.ini file, and i could not find a
> my.cnf file at all.
>
> So, is there one place that i can make this change for good? or is
> there a certain syntax that i need to use? Could you please give me
> some high-level instructions?
>
> What i do know:
> --------------------------------------------------------------
> -I do know that i would need to log on as root, and make this[/color]
change.[color=blue]
> -I do know that the service reads its values from my.ini - and
> supposedly uses any overrides from a my.cnf file. (I was not able[/color]
to[color=blue]
> find the my.cnf file)
> -I do have the latest (4.0) version of MySql on the server.
>
> What i tried already:
> 1. I added 2 lines to the my.ini file
> max_connections=300
> wait_timeout=2
>
> 2. I logged on as root and ran:
> SET GLOBAL max_connections=300
> SET GLOBAL wait_timeout=2
> Then i ran the mysqladmin.exe and created the Report of the[/color]
variables:[color=blue]
> The Report states that i got
> max_connections 100
> wait_timeout 28800
> (Grrr!)
>
> Also, I cannot make drastic programming or connection changes in[/color]
code[color=blue]
> because i am in the process to move the data layer over to SQL[/color]
Server[color=blue]
> 2000.
>
> Sorry for being ignorant here, i have taken this project over and[/color]
am[color=blue]
> no expert on mysql.
>
> Please help if you have any basic instructions.[/color]

On Windows, you change the "ini" settings thru winmysqladmin
graphical interface. Open it up, and there is a tab for changing ini
settings. Restart the server and you should be ok.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/mySQL-change...ict129017.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=433118
Closed Thread