Here is my problem: i need to make a lock on a table from my database.(I'm using MySQL database server). When i work from my terminal, everithing is ok. It locks my table and if I try to insert a new row, gives me some error. But problem is that when I try to do the same thing from phpmyadmin or MySQL Query Browser, there is no effect. Can anybody explain me the reason?
Thanks in a开发者_如何学运维dvance!
I'm assuming it has to do with your connection. That's why it works on your terminal (connection is still the same), but not on phpmyadmin. No experience with MySQL Query Browser, but I suspect the same issue.
from http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html
If the connection for a client session terminates, whether normally or abnormally, the server implicitly releases all table locks held by the session
phpmyadmin for instance doesn't keep your connection alive all the time, so you can lock, but not press that 'sql' button, do your lock, and have the lock held for another seperate query. It should work when putting all the commands back-to-back separated with ;
精彩评论