Read rows while protecting against conflicting writes.
Section: locking and concurrency
Lock rows for shared reads
sql
sql
SELECT * FROM products WHERE id = 10 FOR SHARE;Explanation
Use shared locks when you want consistency without taking an exclusive update lock.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing locking and concurrency
Lock selected rows for update
Prevent concurrent modifications to matched rows inside a transaction.
Set transaction isolation level
Control read consistency and concurrency behavior.
Inspect InnoDB lock and transaction state
Display detailed InnoDB diagnostics.
Set lock wait timeout for the session
Avoid waiting too long on blocked locks.