user4640007
user4640007

Reputation: 97

MySQL Access Denied for user ''@'localhost'

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?

Upvotes: 0

Views: 1263

Answers (1)

Vhortex
Vhortex

Reputation: 381

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.

Upvotes: 2

Related Questions