title: ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
body: <p>I know this question is asked many times, and I read al lot of questions going about this, but I think mine is different.</p>
  
  <p>I use a Mac with version 10.10.3 and a Terminal to do my commands.</p>
  
  <p>I am trying to create a local database (and I did it before), but for some reason the access is constantly denied.</p>
  
  <p><strong>This is how my terminal looks like:</strong></p>
  
  <pre><code>iMac-van:mysql 639$ /usr/local/mysql/bin/mysql -v
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 2
  Server version: 5.6.24 MySQL Community Server (GPL)
  
  Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  
  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective
  owners.
  
  Reading history-file /Users/639/.mysql_history
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  
  mysql&gt; quit;
  Writing history-file /Users/639/.mysql_history
  Bye
  iMac-van:mysql 639$ /usr/local/mysql/bin/mysql -u root
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 3
  Server version: 5.6.24 MySQL Community Server (GPL)
  
  Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  
  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective
  owners.
  
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  mysql&gt; create database wordpress_db;
  ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'wordpress_db'
  </code></pre>
  
  <p>As you can see I can login to mysql, but I have no permission to create a database. </p>
  
  <p>I tried to login like:</p>
  
  <pre><code>$ /usr/local/mysql/bin/mysql -u root
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>$ /usr/local/mysql/bin/mysql -u root -p
  </code></pre>
  
  <p>I have no password, but I can enter mysql without one, but then I cannot create a database.</p>
  
  <p>Select current_user(); returns this:</p>
  
  <pre><code>mysql&gt; select current_user();
  +----------------+
  | current_user() |
  +----------------+
  | @localhost     |
  +----------------+
  1 row in set (0,00 sec)
  </code></pre>