title: mysql CREATE DATABASE using variable
body: <p>I have written an SQL script to create a database. But I can't seem to figure out how to declare a string variable and reference it afterwards in SQL code. I figure this is a very basic sort of thing, so I must be confused about something here.</p>
  
  <p>All the examples I found use the <code>SET</code> keyword.</p>
  
  <pre><code>SET @dbname = "mydb";
  CREATE DATABASE @dbname;
  </code></pre>
  
  <p>What am I missing here?</p>