How can I lock a database in MySQL so that >1 instances of same user are prohibited?
If I use flush tables with read lock; to lock all my tables, but I have >1 processes who are using the same username & password to acc开发者_JAVA百科ess the database, how can I tell MySQLd to only allow one client at a time?
Thanks.
I'm not sure why you think you need it, but tou can change the max_user_connections
limit for the user and set it to 1:
- http://dev.mysql.com/doc/refman/5.5/en/user-resources.html
精彩评论