-3

Can anyone please help me with this. I cannot access phpMyAdmin. I am using WAMPSERVER 2.4 and running Windows 7 32-bit OS.

Everytime I try to access phpMyAdmin it gives an error like this:

Error MySQL said: Documentation

1045 - Access denied for user 'root'@'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Community
  • 1
  • 1

2 Answers2

1

Like all versions of MySQL after initially installing it there is only one User account available.

The username is root and there is no password on this account.

So on the login page for phpMyAdmin enter:

username = root
password = leave this empty

Once you are logged in, add a password to this account. And dont forget it!

Once you have set a password, and tested that you can login again with that password you can make a simple change to this file:

c:\wamp\www\apps\phpmyadminx.y.z\config.inc.php

Look for :

$cfg['Servers'][$i]['AllowNoPassword'] = true;

and chnage it to

$cfg['Servers'][$i]['AllowNoPassword'] = false;

This will stop phpmyadmin allowing access using a userid that does not have a password.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • In this case it doesn't seem like the root password is empty, since root@localhost was denied access with "using password: NO". Some WAMP install sets the initial root password to "root", maybe it's the case here ? – Hugehornet Sep 25 '13 at 11:49
  • @Hugehornet Did you install over an existing older WAMP? Or did you copy an older wamp's mysql\data folder into the new install? – RiggsFolly Sep 25 '13 at 13:30
0

Edit your phpmyadmin config.inc.php file :

$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Shakti Patel
  • 3,762
  • 4
  • 22
  • 29