Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My mysql password = '' i try to login to PhpMyAdmin (on Ubuntu 10.04 lamp) and get error: Login without a password is forbidden by configuration (see AllowNoPassword) What should i do for enter to phpMyAdmin without set password? Thanks

share|improve this question
up vote 18 down vote accepted

You can turn on the option AllowNoPassword on file /etc/phpmyadmin/

Edit the file, search and uncomment this line:

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

Then you can access PhpMyAdmin without password.

share|improve this answer
This command can help (tested on Ubuntu 10.04): sed '/^ .*AllowNoPassword.*/ s/\/\///' /etc/phpmyadmin/ > /tmp/conf.tmp && mv /tmp/conf.tmp /etc/phpmyadmin/ – Neto May 21 '10 at 13:51
Thanks, I make that, after that i restart apache and mysql but i still get: Login without a password is forbidden by configuration (see AllowNoPassword) – Yosef May 21 '10 at 14:07
I also run: sudo sed '/^ .*AllowNoPassword.*/ s/\/\///' /etc/phpmyadmin/ > /tmp/conf.tmp && mv /tmp/conf.tmp /etc/phpmyadmin/ but i get: mv: try to overwrite /etc/phpmyadmin/', overriding mode 0644 (rw-r--r--)? y mv: cannot move /tmp/conf.tmp' to `/etc/phpmyadmin/': Permission denied – Yosef May 21 '10 at 14:10
Try to get root before run the command. Execute: sudo -s and then the sed command. Finally, ajust the permissions: chmod 640 /etc/phpmyadmin/ && chown root:www-data /etc/phpmyadmin/ – Neto May 21 '10 at 14:51
I don't believe this solution works anymore in Ubuntu 14.04. I edited /etc/phpymyadmin/ to uncomment/enable that line, run sudo /etc/init.d/apache2 restart, refresh the website, try and login with root and no password and the AllowNoPassword error continues to occur. – bafromca Jan 19 '15 at 22:47

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
  • 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 and config-db.php are owned by www-data, then phpmyadmin will not

share|improve this answer

use Sudo to access the following file that mention above (etc/phpmyadmin/ 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

share|improve this answer

Open phpmyadmin config file

sudo nano /etc/phpmyadmin/

/* Uncomment the following to enable logging in to passwordless accounts,
     * after taking note of the associated security risks. */
     $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.