0

I'm trying to create a database in terminal but I get the error

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mydatabase'

All I've done so far is install mysql and install the workbench to go along with it.

This is my personal computer so I have administrator privilege from this log-in account.

Another thing is that the database I created in the workbench doesn't show up when I type the command

SHOW DATABASE;

in the terminal.

Mars
  • 4,677
  • 8
  • 43
  • 65
  • 1
    Have you set a root password? If not, [read these docs first](http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html) to set one, after which you may grant privs for other users. Specify those other users on the command line `mysql -u username -p'password'` – Michael Berkowski Oct 07 '13 at 18:21
  • possible duplicate: http://stackoverflow.com/questions/8838777/error-1044-42000-access-denied-for-user-localhost-to-database-db – Black Sheep Oct 07 '13 at 18:23

1 Answers1

2

You've to login. Try:

mysql -u root -p

You will be asked for a password.

More information: mysql --help

Hope that helps. :-)

Mr. B.
  • 8,041
  • 14
  • 67
  • 117