title: Create a MySQL database in python
body: <p>I am looking to a create a MySQL database from within Python. I can find instructions  for how to connect to an existing database, but not how to initialize a new one. </p>
  
  <p>For example, when i run the line</p>
  
  <pre><code>import MySQLdb
  db = MySQLdb.connect(host="localhost", user="john", passwd="megajonhy", db="jonhydb")  (presumably because connecting will not create a database if it doesn't already exist, as i had hoped)
  </code></pre>
  
  <p>Which is the first line of instructions on <a href="https://stackoverflow.com/questions/372885/how-do-i-connect-to-a-mysql-database-in-python">How do I connect to a MySQL Database in Python?</a> I get the error <code>_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")</code></p>
  
  <p>How do i go about initializing a new MySQL database to work with?</p>