MySQL error 1045 when tried to use it

Asked By 0 points N/A Posted on -
qa-featured

Hello.

I have installed WAMP server on my computer, configured it as specified, with root and a new password. 

I am also using localhost as a host. But when I try to start all servers in WAMP, I get the following error that there is a problem with MySQL.

MySQL Query Browser Error

Could not connect to the specified instance.

MySQL Error Number 1045

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

If you want to check the network connection, please click the Ping button.

SHARE
Best Answer by Allen Kenneth
Answered By 20 points N/A #122583

MySQL error 1045 when tried to use it

qa-featured

It shows that a root has a password but you are not giving a password.  That is why your access is denied.  You must provide a password for the root user to get access and enable you to use it.  When ever you don't supply a password, you will not be given access.

The second method to solve this problem, you should do the following.

edit config.inc.php –> change $cfg['onaAbsoluteUri']=;  to $cfg[PmaAbsoluteUri']="localhost/phpmyadmin/"

then change $cfg[server'[$i][host]=localhost; to $cfg['Servers'][$i]['host'] = 'Localhost'; now enter your password.

Best Answer
Best Answer
Answered By 20 points N/A #122584

MySQL error 1045 when tried to use it

qa-featured

Hello Alexander,

MySQL Error #1045 – Access denied for user root@ localhost (using password: NO) has been bothering majority of php developers. Try the following set of code. This will work for you as it has worked for a bunch of people i've known.

Just edit the config.inc.php, which can be found in the libraries of phpMyAdmin as mentioned below

Replace line: 

$cfg['PmaAbsoluteUri'] = '';

to

$cfg['PmaAbsoluteUri'] = 'localhost/phpmyadmin/';

and also replace line: 

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = 'Localhost';

And also you can use this method as well. Locate phpmyadmin/scripts/signon.php and run it in your browser. (http://localhost/phpmyadmin/scripts/signon.php). You will be directed to a login window. Provide the login details as:

Username: root
Password: Your password
Host: localhost
Port: 3306

and submit the query. After that another login window appears and you will have to enter MySQL information before continuing . This method is a bound to work.

Hope this will be useful. 

 

 

Related Questions