I know maybe this is a frequent question, and I also have searched before asking.But I still have some points cannot figure out myself, help you can help me. Thanks in advance.
How does deadlock happen in MySQL? Mysql gives an example in the manual(https://dev.mysql.com/doc/refman/8.0/en/innodb-deadlock-example.html), it's seems two unrelated tables being operated, so I really don't get how deadlock occurs between two tables.
I saw some people say deadlock also happened in SELECT...FOR UPDATE lock, due to process order. Is true? Does the 'SELECT...FOR UPDATE' lock put the exclusive lock initially? So how did this happen?
If both can face deadlock situations, is there any workaround to deal with it?