title: How can I check string length before insert in MySQL?
body: <p>I created a table with the following statements in MySQL.</p>
  
  <pre><code>CREATE TABLE Users (
     UserName VARCHAR(15) NOT NULL PRIMARY KEY,
     Password VARCHAR(15) NOT NULL,
     Active Bool DEFAULT TRUE
  )
  </code></pre>
  
  <p>So I want make a 2 trigger on this table:</p>
  
  <ol>
  <li>Check the UserName and Password to be more than 4 or 8 characters. (Check the minimum length of string in inserting new rows)</li>
  <li>Make some regular expression to check the password. For example I want it contains both Upper case and lower case characters and numbers.</li>
  </ol>
  
  <p>Please guide me.
  Thanks a lot.</p>