title: How do I quickly rename a MySQL database (change schema name)?
body: <p>The MySQL manual at <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="nofollow noreferrer">MySQL</a> covers this.</p>
  <p>Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently <code>RENAME {DATABASE | SCHEMA} db_name TO new_db_name;</code> <a href="http://web.archive.org/web/20160504181056/https://dev.mysql.com/doc/refman/5.1/en/rename-database.html" rel="nofollow noreferrer">does bad things, exists only in a handful of versions, and is a bad idea overall</a>.</p>
  <p>This needs to work with <a href="http://en.wikipedia.org/wiki/InnoDB" rel="nofollow noreferrer">InnoDB</a>, which stores things very differently than <a href="http://en.wikipedia.org/wiki/MyISAM" rel="nofollow noreferrer">MyISAM</a>.</p>