If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > using one database user or multiple

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-02-09, 14:25
jkuiper jkuiper is offline
Registered User
 
Join Date: Dec 2008
Posts: 8
using one database user or multiple

In mysql it is very simple to make use of the userfile. Therefore you can create multiple users on different databases and different priveliges. I know with web connections, it is better to use one user for all connection and queries.
But I delevope a client server application.
What is the best way to do. We using INNODB for recordlocking.
Reply With Quote
  #2 (permalink)  
Old 01-02-09, 15:16
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 7,173
if its a client server application then I'd strongly reccommend one user one userid. so if you have 50 users, thats 50 userids
__________________
I'd rather be riding my Versys
Reply With Quote
  #3 (permalink)  
Old 01-02-09, 15:41
jkuiper jkuiper is offline
Registered User
 
Join Date: Dec 2008
Posts: 8
But does mysql knows who locking the record?
Reply With Quote
  #4 (permalink)  
Old 01-02-09, 16:19
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 7,173
why would MySQL need to now who was locking the record?
if your application needs to know who locked the record, then your appliciation needs to provide that to the db. whether you do that as part of an audit record thats up to you

as to how you identify the user to the db, you do that as part of the connection, through what ever mechanism you are using.... the front end has to estgablish a connection to the db..... normally thats where you would sepcify the userid and password
__________________
I'd rather be riding my Versys
Reply With Quote
  #5 (permalink)  
Old 01-02-09, 16:46
jkuiper jkuiper is offline
Registered User
 
Join Date: Dec 2008
Posts: 8
So conclusion:
- use one database user to connect from client to server on several pc's
- create an own user file with its own priveliges.
- use pooling for several connections
- One client lockes a record and onother client will getting a message by trying to edit it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On