What assumptions are needed to prove that $(ab)c=b(ac)$ implies commutativity & associativity? The question is in the title: I would like to know what extra assumptions (if any) are needed for the following derivation that $(a\cdot b)\cdot c=b\cdot(a\cdot c)$  implies commutativity, i.e. $a\cdot b=b\cdot a$, and associativity, i.e. $(a\cdot b)\cdot c=a\cdot (b\cdot c)$.
If I assume the existence of an identity satisfying $a\cdot1=a$ for all $a$ in consideration, then
$$a\cdot b=(a\cdot b)\cdot 1=b\cdot(a\cdot 1)=b\cdot a,$$
so we have commutativity, and given commutativity, we get
$$(a\cdot b)\cdot c=(b\cdot a)\cdot c=a\cdot(b\cdot c),$$
which is associativity.
Are there any structures with no identity element such that $(a\cdot b)\cdot c=b\cdot(a\cdot c)$ for all $a,b,c$, but the operation is not commutative? Can other axioms be used in place of an identity (like, say, a cancellation law $a\cdot c=b\cdot c\implies a=b$)?

Consider matrices with even entries modulo $8$. Any product of three such matrices is zero, but we do not have commutativity.
