MYSQL too many connetions error message

Hello Experts,
while our new app is being developed by our provider
we are adjusting our legacy about to retire as much as possible.

I am getting error "odbc too many connections " from MySQL server
why is this?

Maybe is because in each piece of source we open a connection execute a command and close the connection?
Should I have one only connection all the session?

Each time I need to add/update or delete I follow the same steps
that is:

    con1 = SQLCONNECT("connex","root","root")
    R2 = SQLEXEC(con1,v2)
    R4=SQLDISCONNECT(Con1)

Works just fine until the " TOO MANY CONNECTIONS " error message.

What is your advice here?
Regards
RGuillermoProject ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Prabhin MPEngineer-TechOPSCommented:
Hi,
Please check how you max connection does your instance support using the following command

mysql> show variables like "max_connections"

To increase the global number of connections temporarily, you can run the following from the command line:

set global max_connections = 200

then you check. hopefully this should solve your question
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RGuillermoProject ManagerAuthor Commented:
it was set to 151
your advice leads us to find the following...

SET GLOBAL interactive_timeout = 60;
SET GLOBAL wait_timeout = 60;

Now each sleeping connection is being erased by the server after 60secs
so we never reach the max.... this we just learned

Hope we are doing good and has no consequences..
So far .. problem solved !!

Thank you much !!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.