title: Rails and Mysql2 Access denied for user 'root'@'localhost' (using password: NO)
body: <p>I am somewhat new to Rails, and much of my experience involves me feeling out how to work out the problem so I apologize in advance if I have missed and obvious solution. I run a Windows machine.</p>
  
  <p>I am creating a log-in and registration using mysql2. MySQL installer has already been used to install the server, workbench, etc. (I configured the root password as password) and I have already installed the mysql2 gem.</p>
  
  <p>The rails was bundled successfully but when I entered <code>rake db:create</code>, the error <code>Access denied for user 'root'@'localhost' (using password: NO)</code> occurred.</p>
  
  <p>Rails then prompted me for my password, I entered it but the error occurred again. After entering my password the second time, it seemed as if it worked fine until I tried to do a <code>rails db:migrate</code> wherein the error appeared again making it not possible to migrate.</p>
  
  <p>This confuses me because in the MySQL query, I have my password set as the same one I entered. I tried giving the 'root' user all the schema privileges, but that made no difference. Please tell me how to solve this problem and thank you.</p>
  
  <p>If you have any questions about my question, please ask.</p>