mysql鎖

mysql鎖   宏觀 數據庫鎖 粒度小,方便用於集羣環境 代碼鎖 粒度大,需要封裝 微觀 innodb 分類(種類)     for update 僅適用於InnoDB,並且必須開啓事務,在begin與commit之間才生效。 行鎖&表鎖 `只有明確指定主鍵,纔會執行行鎖,否則執行表鎖` 無鎖 `主鍵不存在` select * from user where id = -1 for update
相關文章
相關標籤/搜索