Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

4 Answers 4

up vote 12 down vote accepted

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.

share|improve this answer
    
This command can help (tested on Ubuntu 10.04): sed '/^ .*AllowNoPassword.*/ s/\/\///' /etc/phpmyadmin/config.inc.php > /tmp/conf.tmp && mv /tmp/conf.tmp /etc/phpmyadmin/config.inc.php –  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/config.inc.php > /tmp/conf.tmp && mv /tmp/conf.tmp /etc/phpmyadmin/config.inc.php but i get: mv: try to overwrite /etc/phpmyadmin/config.inc.php', overriding mode 0644 (rw-r--r--)? y mv: cannot move /tmp/conf.tmp' to `/etc/phpmyadmin/config.inc.php': 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/config.inc.php && chown root:www-data /etc/phpmyadmin/config.inc.php –  Neto May 21 '10 at 14:51

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

share|improve this answer

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

share|improve this answer

Open phpmyadmin config file

sudo nano /etc/phpmyadmin/config.inc.php

/* 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

 
discard

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.