title: Automatically encrypt varchar MySQL
body: <p>I have a table in mysql that has 5 fields. They are arranged like this:</p>
  
  <pre><code>id | name | email | username | password
  </code></pre>
  
  <p>What I want to do, is automatically hash the password when a value is inserted without having to call the md5 function.</p>
  
  <p>So this is the query I tried using to get that affect:</p>
  
  <pre><code>CREATE TABLE users (
  id int NOT NULL AUTO_INCREMENT, 
  name VARCHAR(255) NOT NULL, 
  email VARCHAR(255) NOT NULL, 
  username VARCHAR(255) NOT NULL, 
  password md5(VARCHAR(255)) NOT NULL, 
  PRIMARY KEY(id)
  );
  </code></pre>
  
  <p>Can I do something like this or will I have to call md5() whenever there is an <code>INSERT INTO</code> statement?</p>
  
  <p>I know md5 is not as secure as others, etc, etc. No need to suggest other encryption algorithms. </p>