title: SQL reset AUTO_INCREMENT when DELETE statement empties table
body: <p>i need to create a trigger when a DELETE command on a table is launched.</p>
  <p>i have some problems on my code:</p>
  <pre><code>CREATE TRIGGER reset_AutoIncrement 
  AFTER DELETE ON table1 
  FOR EACH ROW 
  ALTER TABLE table1 AUTO_INCREMENT = 0;
  </code></pre>
  <p>I want to reset AUTO_INCREMENT value when</p>
  <p><code>mysql&gt; DELETE * from table1.</code></p>
  <p>Only when the command is called to empty <strong>the entire table</strong>.</p>
  <p>When i try to create this trigger the following error returns:</p>
  <p><code> ERROR 1422 (HY000): Explicit or implicit commit is not allowed in stored function or trigger.</code></p>
  <p>I'm working on mysql CLI. Not workbench or similar.</p>
  <p>Can anyone help me?</p>