title: MySQL: Name primary key in CREATE TABLE statement
body: <p>How do I set the name of a primary key when creating a table?</p>
  
  <p>For example here I'm trying to create a primary key with the name 'id', but this is invalid SQL. Can you tell me the correct way to do this?</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `default_test`
  (
      `default_test`.`id` SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY `id`,
      `default_test`.`name` LONGTEXT NOT NULL
  )
  </code></pre>
  
  <h2>Clarification</h2>
  
  <p>I'd like to specify the name of the primary key - rather than the default name of "PRIMARY" I'd like it to be called "id" or perhaps "primary_id", so if I were to later run SHOW INDEXES FROM default_test, the Key_name will be something I have specified.</p>