Solved

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

Posted on 2014-12-28
3
112 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 82

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 24

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

708 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

13 Experts available now in Live!

Get 1:1 Help Now