title: MySQL how to cascade on delete without foreign key
body: <p>Alright so first let me introduce my schema.</p>
  
  <p>table: users</p>
  
  <pre><code>Field    |     Type    |  Key  |  NN   | AI
  ---------------------------------------------
  id       | int(11)     | PRIM  |  YES  | YES
  username | varchar(50) |       |  YES   | NO
  banned   | int(1)      |       |  YES   | NO
  
  Foreign keys: none
  </code></pre>
  
  <p>table: macs</p>
  
  <pre><code>Field    |     Type    |  Key  |  NN   | AI
  ---------------------------------------------
  id       | int(11)     | PRIM  |  YES  | YES
  address  | varchar(50) |       |  YES   | NO
  lastacc  | timestamp   |       |  YES   | NO
  
  Foreign keys: none
  </code></pre>
  
  <p>table: usermac</p>
  
  <pre><code>Field    |     Type    |  Key  |  NN   | AI
  ---------------------------------------------
  userId   | int(11)     | PRIM  |  YES  | NO
  macId    | int(11)     |       |  YES  | NO
  
  
  Foreign keys:
  [FK: macId] references macId to id in table macs
  [FK: userId] references userId to id in table users
  </code></pre>
  
  <p>The scenario is, I have a userId and wish to delete all records in macs that are linked to that userId (as stated by records in usermac)</p>
  
  <p>The relation between users and macs: a user can have multiple macs and a mac can belong to multiple users.</p>
  
  <p>What SQL query should I perform for this? I tried cascading delete but cascading does not work.</p>
  
  <p>Thanks in advance for your answer.</p>