3

I really need help to fix this error, because next Monday is my final year project presentation, please. I don't know how to fix this.

I've try to follow this http://www.ishaanrawat.com/solved-wampserver-1045-access-denied-for-user-rootlocalhost-using-password-no/ instruction, but I get the same error.

And, a few minute ago, I uninstall wamp sever, in hope after installing it again, I can use my wamp server normally, but still the same error.

Below is the 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
Jasmine Ziz
  • 47
  • 2
  • 2
  • 9

6 Answers6

8

You can watch to solve your problem
http://www.youtube.com/watch?v=BgcW4h6ZAro&t=7m21s
p/s: this is Vietnamese video :)
in config.inc.php you edit folowing code:

* First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//uncomment this
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//comment this
//$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

then exit wampserver, reopen wampserver, open PHPMyadmin, you'll show login form :)

Tiep Phan
  • 10,973
  • 2
  • 33
  • 36
3

Go to phpMyAdmin folder inside of XAMPP or WAMPS server and open config.inc.php file. And Change username and password to set in your db.

 /* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
Abu Sufian
  • 331
  • 3
  • 4
2

This worked for me. Prior to installing WAMP, I had MySQL installed in my computer. The password required to open the MySQL command line client was, let's say "pw". Now, after installing WAMP, it gave the same error as your when I tried to open phpMyAdmin. How to fix this:

  1. Open C:\wamp\apps\phpmyadmin4.1.14\config.inc.php
  2. Locate these lines:

    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    /* Server parameters /
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    /
    Select mysql if your server does not have mysqli */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;

  3. Change " $cfg['Servers'][$i]['AllowNoPassword'] = true; " to " $cfg['Servers'][$i]['AllowNoPassword'] = false; ".

  4. Change " $cfg['Servers'][$i]['password'] = '' " to " $cfg['Servers'][$i]['password'] = 'pw' ". (Remember to put your password instead of 'pw' ).

  5. Restart all services in WAMP and try opening phpMyAdmin again. Hope it works now!

Ankit Shubham
  • 1,909
  • 1
  • 24
  • 48
1

u first change the "AllowNoPassword" value to false in config.inc.php. then set password for root then login to phpmyadmin.

0

The solution is:

  1. Backup All your projects and database first.

  2. Uninstall lampp from your system (Ubuntu 16.04).

  3. Re-install lampp.

  4. Open phpmyadmin. The error has not been removed yet.

  5. Open config.inc.php of phpmyadmin folder.

  6. Make changes to these lines:

    /* Authentication type and info */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'your password';
    
  1. Now save the file (if unable to save then write):

    sudo -H gedit /opt/lampp/phpmyadmin/config.inc.php
    
  2. Restart your xampp server.

  3. Go to localhost/phpmyadmin again. Try to login with root as username and leave the passwords filed blank. If this doesn't works then login with the password you have entered.

Good Luck!

Lunivore
  • 16,218
  • 4
  • 41
  • 86
-2

Remove xampp and install mysql,phpmyadmin,php5, apache2 manully.

  1. sudo su
  2. apt-get install mysql-server mysql-client
  3. apt-get install apache2
  4. apt-get install php5 libapache2-mod-php5
  5. apt-cache search php5 Pick the ones you need and install them like this: apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
  6. apt-get install phpmyadmin
  7. service apache2 restart
  8. then open http://127.0.0.1/phpmyadmin/

These upper commands will make your xampp server. It will resolve your problem quickly and worked very smoothly. thanks to related articles:

  1. Ubuntu 14.10 LAMP server tutorial with Apache 2, PHP 5 and MySQL (MariaDB)
  2. How do I change the root directory of an apache server?
Community
  • 1
  • 1
alok
  • 2,380
  • 18
  • 15