Solved

MySQL - Prevent a user login to be connected more than 1 time.

Posted on 2014-12-28
3
114 Views
Last Modified: 2014-12-29
Hello,
Is there a way in MySQL to prevent 2 or more end devices in a networking environment to be connected at the same time using the same login parameters (User ID and Password)?
0
Comment
Question by:Omer-Pitou
3 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
ID: 40521207
I wouldn't think so.  That is a pretty common occurrence.  Software, particularly web pages, often use the same username and password on multiple computers to connect to an application specific database.
0
 
LVL 1

Assisted Solution

by:dvonderburg
dvonderburg earned 167 total points
ID: 40521211
If each end device on the network uses different user id or logins you can use the max_user_connection and set it to 2. But I think it is global and will set it for all accounts.

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_user_connections
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 167 total points
ID: 40521446
Hi!

This can be done by limiting resources to the user.
http://dev.mysql.com/doc/refman/5.5/en/user-resources.html
I would not set this globally if you have a server that has system-users dedicated to web systems or other systems using multiple connections as Dave is pointing out.
But you can limit other and/or certain users using the method I mentioned above.

Regards,
     Tomas Helgi
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now