PhpMyAdmin (on ubuntu lamp): Login without a password is forbidden by configuration (see AllowNoPassword)

Solution 1:

You can turn on the option AllowNoPassword on file /etc/phpmyadmin/config.inc.php.

Edit the file config.inc.php, search and uncomment this line:

// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

Then you can access PhpMyAdmin without password.

Solution 2:

Here is what I have noticed from attempting to solve this problem. what I went through:

  1. I set $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  2. I go to phpmyadmin and login fine without password ..No problem

Then I wanted to run apache with a different user than www-data so I

  • I go to /etc/apache2/eenvvars and I edit export APACHE_RUN_USER=myuser and export APACHE_RUN_GROUP=myuser

I restart apache2 and when I try to login to phpmyadmin without password it does not let me event though, as I previously mentioned, I set $cfg['Servers'][$i]['AllowNoPassword'] = TRUE.

To resolve it

  • I go to /etc/phpmyadmin/
  • check the permission (run ls-l)
  • I notice that it is root:www-data for config-db.php and for config.inc.php
  • I run sudo chown root:myuser
  • Restart apache
  • Then go to phpmyadmin and login with passowrd...It works

If you run apache with a different other than www-data (i.e you own) and your config.inc.php and config-db.php are owned by www-data, then phpmyadmin will not

Solution 3:

use Sudo to access the following file that mention above (etc/phpmyadmin/config.inc.php.) and also stop apcaha before editing this file with this

// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

else it will wont allow you to update it. Command for stopping apcahe

sudo /etc/init.d/apache2 stop

hope it will help it works for me