0

I am having trouble creating a database on my local server using MySQL.

Approach:

Start mysqld as administrator
Start MySQL as administrator

mysql> create database db_name;

MySQL throws an error indicating, "Access Denied for user ''@'localhost to database 'db_name'.

What do I need to specify to MySQL to create a database?

4
  • I am using windows 7 Commented Jun 10, 2015 at 2:37
  • Type show grants for 'administrator'@'localhost'; What do you see? Commented Jun 10, 2015 at 2:41
  • access denied for user ''@'localhost' to database 'mysql' Commented Jun 10, 2015 at 2:47
  • Please review @Vhortex answer. Commented Jun 10, 2015 at 2:49

1 Answer 1

2

You need to provide a valid user/password combination to gain access to MYSQL. You also need that the user you are using have the privileged to create a database.

On default, new users have zero access to the database management including creation.

Sign up to request clarification or add additional context in comments.

3 Comments

I recall being able to login just fine. I guess I forgot how to login
Usually the problem is with the user access. This might help but it is worth a shot, you can strictly forced a username to be able to access with only a specific hostname/ip address. NOTE: @Tim Biegeleisen beats me to is
Alright. Thanks. Perhaps if I can just burn this into my brain (or save a text file) MySQL will only work through the command prompt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.