title: mysql error 1364 Field doesn't have a default values
body: <p>My table looks like</p>
  
  <pre><code>create table try ( name varchar(8), CREATED_BY varchar(40) not null);
  </code></pre>
  
  <p>and then I have a trigger to auto populate the CREATED_BY field </p>
  
  <pre><code>create trigger autoPopulateAtInsert BEFORE INSERT on try for each row set new.CREATED_BY=user();
  </code></pre>
  
  <p>When I do an insert using  </p>
  
  <pre><code>insert into try (name) values ('abc');
  </code></pre>
  
  <p>the entry is made in the table but I still get the error message</p>
  
  <pre><code>Field 'CREATED_BY' doesn't have a default value Error no 1364
  </code></pre>
  
  <p>Is there a way to suppress this error without making the field nullable AND without removing the triggfer? Otherwise my hibernate will see these exceptions ( even though the insertions have been made) and then application will crash.</p>