title: ActiveRecord::StatementInvalid: Mysql2::Error: Can't create database 'sharetribe_development' (errno: 2)
body: <p>Hello I'm setting up a rails 3.2.21 project in MAC OS X Yosemite. while running the command <code>rake db:create</code> I got the following error</p>
  
  <blockquote>
    <p>rake aborted!
    ActiveRecord::StatementInvalid: Mysql2::Error: Can't create database 'sharetribe_development' (errno: 2): CREATE DATABASE <code>sharetribe_development</code> DEFAULT CHARACTER SET <code>utf8</code> COLLATE <code>utf8_unicode_ci</code></p>
  </blockquote>
  
  <p>I don't know why I'm getting this error.I can access mysql using <code>mysql -u root</code> 
  and here is my database.yml </p>
  
  <pre><code>development:
      adapter: mysql2
      database: sharetribe_development
      encoding: utf8
      username: root
      password:
      host: localhost
  </code></pre>
  
  <p>I got stucked with this thing whole day.Any suggestion will be appreciated</p>
  
  <h3>EDIT 1</h3>
  
  <p>in mysql, I've following databases</p>
  
  <pre><code>mysql&gt; show databases;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  +--------------------+
  1 row in set (0.00 sec)
  </code></pre>
  
  <h2>EDIT 2</h2>
  
  <p>I added gem 'mysql2', '~> 0.3.20' on gem file.I'm using rails 3.2.21.I got another problem. I reinstalled mysql. after installation, I can successfully access mysql using <code>mysql -u root</code> but after the execution of command <code>rake db:create</code> it throws following error.</p>
  
  <blockquote>
    <p>Access denied for user 'root'@'localhost' (using password: YES). 
    Please provide the root password for your mysql installation</p>
  </blockquote>
  
  <p>after this on trying to access mysql I can't access it.It says  <strong>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</strong></p>
  
  <p>I didn't set any password for mysql.but I'm unable to access it.</p>