anjali
anjali

Reputation: 77

Using WAMPSERVER and getting issue

I am using WAMPSERVER for creating a database using MYSQL. I wrote a basic query for creating a database that is:

CREATE DATABASE mydb

Upon clicking the go button, I am getting the error:

#1044 - Access denied for user ''@'localhost' to database 'mydb'

Please tell that what can I do in this case. Thanks a lot for giving me your important time.

Upvotes: 1

Views: 1123

Answers (3)

RiggsFolly
RiggsFolly

Reputation: 94682

The error code

#1044 - Access denied for user ''@'localhost' to database 'mydb'

Suggests that you have not logged in using a userid.

All installations of MySQL comes with a default userid setup of 'root' ( no quotes )

So try logging in again and use:

username = root
password = (leave this blanks)

You should then see a screen with a add password link on it. Click that and give the root userid a password, for security. Dont forget that password.

Now you will be properly logged in to mysql and will have the required privilages to do, well anything, as the root userid is the super user.

Upvotes: 0

anjali
anjali

Reputation: 77

I have solved this issue..

Open the config.inc.php file in phpMyAdmin folder and change the username and password which you like to set. Just check following code.

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'Enter-Username';
$cfg['Servers'][$i]['password'] = 'Enter-Password';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;

Upvotes: 2

Chris
Chris

Reputation: 2950

You need to authenticate with the mysql server, and then check you have the correct permissions to create databases with the authenticated user.

Upvotes: 0

Related Questions