Jump to content

Handle Max_User_Connection?


mabaomsi

Recommended Posts

Hi, i'm Balázs form Hungary, and i have a question for YOU ALL! :D

 

I have a application with a HeliHost MySQL ONLINE database. I created a table in my database for users (username, pass, join date etc...), that can register for my program (in my program). After register, the user become a new line with all the data, which there has entered under the registration (username, pass, join date etc...) in my user database. The users can login in to my program, using this "user".

The user enter there username and pass, and if this datas are correct, "READING data from user table", than the user can sucess login. So, the login was sucessfully, the user entered my program. And now it's coming the problem. This program is for it, to have datas (veichles, objects, addons, and for all donwload links etc...) about a simulator game (OMSI 2), and to help the users, finding fastest a component form this simulator game, that he/she wants. So i have more tables, in my ONLINE database.

 

BUT, i use all the time one, my account (admin) to handle, manage, read etc... the database.

When MORE (!!!) users, IN THE SAME TIME want to recive, change datas for example: login, account making, searching/looking for component in a table, coming my problem: ..."user already has more than 'max_user_connections' active connections!"

 

So, the problem can be, that i make all the requests with my ONLY one MySQL account: admin? I need to make users in the Cpanel, when a user register in my program, i need to make all the time a new user in my Cpanel too? And when yes, HOW? It is possible to acces Cpnael with vb.net code, form source, like the MySQL databases?

 

Thanks, and a good afternoon for all!

Balázs Lengyel

 

 

Sorry for my REALLY bad english! :blink:

Edited by mabaomsi
Link to comment
Share on other sites

Hi, no, i think no. I open one connection again, when a new action is coming. Like: new command, reader... ("Mysqlconn.open") So, i have more win. forms, in there i open another connnevtions, and when i use a sqlreader, the system saids you have soon opened a reader, you need one another connection to open a new again.

Link to comment
Share on other sites

Aham, so can I open endless connections? But i dont thik so. When I used ONLY the app, the error didn`t happend, BUT when we (I and my friends, for example) open a "table" / connection in the same time, the error comes... :( So I cant have more than 2 connections in the same time, with my ONLY, one Cpanel (MySQL accesed) account, for ex. a (primary) "admin" account.

Link to comment
Share on other sites

Aham, so can I open endless connections?

No. I have no idea where you got that from. We limit the number of mysql connections each account is allowed to have open at once to prevent the mysql software from becoming overloaded and blocking everyone else on your server from being able to connect to mysql.

 

But i dont thik so. When I used ONLY the app, the error didn`t happend, BUT when we (I and my friends, for example) open a "table" / connection in the same time, the error comes... :( So I cant have more than 2 connections in the same time, with my ONLY, one Cpanel (MySQL accesed) account, for ex. a (primary) "admin" account.

Ok, so say your scripts use 3 persistent connections per user. If there is one user then you have 3 open connections at any time. If you have 2 users then you have 6 persistent connections open at once and you get the error. We have accounts on our servers that have hundreds of simultaneous users and since their code closes their connections they don't see that error.
Link to comment
Share on other sites

Huh,so i need to close all the connection all the time? Or what? 😆😆 But i maked so my script before the error comes, i had 10-20 different connections (but, with the same, admin account, and database), that i forever closed(/conn.). So the essence is, that i can't have more active connections for my database FROM DIFFERENT IP addresses? (Sorry, but dont really understand, how i need to change my scripts...)

Link to comment
Share on other sites

Yeah, my code seem like perfectly this. And from this Open/query/Close statement have i really a lot. But all connection with one maba_user. So and this is the error query, the account maba_user dont allow to have more connections from another computers with another IP-s. I think that is the problem.

Link to comment
Share on other sites

It sounds like you are probably experiencing connection pooling then. Visual Basic tries to "improve" performance by keeping connections open for 4-8 minutes even after you explicitly close them in case you use them again. You should be able to disable connection pooling like this

Public Shared Sub ClearAllPools
Source: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.clearallpools(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
Link to comment
Share on other sites

I think you're running into a limitation of the language you're using at this point. My two suggestions that I can think of now is to try another language that will allow you to properly close your mysql connections or create a different mysql user for each client that you want to connect to your database.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...