title: Correct mysql syntax to change a column with collation
body: <p>This line of code <em>was generated automatically by phpmyadmin</em> (perhaps an old version running on my company's website, but I don't want to deal with that right now):</p>
  
  <pre><code>ALTER TABLE `lc_error_logs` CHANGE `OneDetailedMessage` `OneDetailedMessage` VARCHAR(5000) CHARSET=latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
  </code></pre>
  
  <p>When attempt to execute that SQL, get error message via phpmyadmin:</p>
  
  <blockquote>
    <p>Query error:
     #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MYSQL server version for the right syntax to user near '=latin1 COLLATE  latin1_swedish_ci NULL DEFAULT NULL' at line 1.</p>
  </blockquote>
  
  <p><strong>I don't see what is wrong with the query, and would like to know what is wrong.</strong></p>
  
  <p>Notes:</p>
  
  <ol>
  <li>All I did was change the VARCHAR length.</li>
  <li>Works fine if I delete the column, then recreate it with these same settings. Is just something wrong with that ALTER TABLE syntax.</li>
  <li>I can change INT columns in the same table (e.g. INT to SMALLINT), without any problems. Something about the COLLATE?  But that is the collate we use throughout this DB.</li>
  <li>mysql version:  "5.5.47-0ubuntu0.14.04.1"</li>
  <li>It doesn't matter what values I use for VARCHAR length. It doesn't matter what I attempt to change (e.g. changing column name has the same error.) And I've had this problem before on other tables. I've never been able to successfully alter a VARCHAR in this DB, <em>if I specify collation</em>. (Even though this is the default collation for this DB, generated automatically when I do not specify collation.)</li>
  </ol>