title: What's the difference between "VARCHAR BINARY" and "VARBINARY" in MySQL?
body: <p>I've created the following test table:</p>
  
  <pre><code>CREATE TABLE t (
     a VARCHAR(32) BINARY,
     b VARBINARY(32)
  );
  
  INSERT INTO t (a, b) VALUES ( 'test    ', 'test    ');
  INSERT INTO t (a, b) VALUES ( 'test    \0', 'test    \0');
  </code></pre>
  
  <p>But this query indicated no difference between the two types:</p>
  
  <pre><code>SELECT a, LENGTH(a), HEX(a), b, LENGTH(b), HEX(b) FROM t;
  
  a          LENGTH(a)  HEX(a)              b          LENGTH(b)  HEX(b)              
  ---------  ---------  ------------------  ---------  ---------  --------------------
  test               8  7465737420202020    test               8  7465737420202020    
  test               9  746573742020202000  test               9  746573742020202000  
  </code></pre>