title: MySQL use variable value as database name
body: <p>I have a stored procedure that should create a database using the value of the input variable but instead it just creates a database using the variable name itself.</p>
  
  <pre><code>DELIMITER //
  CREATE PROCEDURE proc_createdb (dbname VARCHAR(128))
  BEGIN
      CREATE DATABASE dbname;
  END //
  </code></pre>
  
  <p>How can I use the value of <code>dbname</code> instead of creating a database called "dbname".</p>