We all know MySQL has different types of locking for
different storage engines.It will vary depends upon the storage
engines which you are using.Here we have explained how the
locking mechanism will work.
There are three types of locking in MySQL,
1.Table level locking,
2.Row level locking and
3.Page level locking.
Table level locking:
Example1:Assume that there is a house with 5 rooms(1,2,3,4,5) and
it is having 3 floors(x,y,z) and each houses are having only
one main door and each floor is having separate door to go
inside the floor.And all the doors are automated when one person
goes inside it will lock until the person is leaving from the
house,floor and room.Here house is a table and rooms are rows and
floors are pages.when a person is going inside the house name A
and it will locked until the person open …