I have a version of phpMyAdmin located on my local Apache server.

I am trying to lớn login without a password however phpMyAdmin keeps throwing the warning:

Login without a password is forbidden by configuration (see AllowNoPassword)

However in my config.php tệp tin for phpMyAdmin I have set:

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

So I don't know why the message is still appearing.

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

asked May 6, 2011 at 8:27

1

  1. Copy config.sample.inc.php to lớn config.inc.php.

In most cases you will find the config file

  • on linux: /etc/phpmyadmin/config.inc.php
  • on mac: /Library/WebServer/Documents/phpmyadmin/config.inc.php
  1. If you are trying to lớn log in as root, you should have the following lines in your config:

    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered May 6, 2011 at 8:37

5

According to lớn this: https://www.simplified.guide/phpmyadmin/enable-login-without-password

This $cfg['Servers'][$i]['AllowNoPassword'] = TRUE; should be added twice in /etc/phpmyadmin/config.inc.php

if (!empty($dbname)) {
    // other configuration options
    $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
    // it should be placed before the following line
    $i++;
}

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

answered Jan 30, năm ngoái at 3:31

I tested the statement:

$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true; 

It did not work for mạ.

Instead, I had to lớn use the correct name AllowNoPassword:

$cfg['Servers'][$i]['AllowNoPassword'] = true; 

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered Jun 17, năm trước at 18:38

1

It doesn't work for mạ. Instead, just add a new user with a password

1 - Login to lớn mysql or mariadb mysql -u root -p

2 - Run these SQL commands to lớn create a new user with all permissions (or grant your custom permissions)

CREATE USER 'someone'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'someone'@'localhost';
FLUSH PRIVILEGES;

2 - Go to lớn /etc/phpMyAdmin/config.inc.php and change this:

$cfg['Servers'][$i]['user']          = 'someone';
$cfg['Servers'][$i]['password']      = 'password';

WARNING: This config is for localhost development server only, If you're running a production server you must use strong credentials and not setting user pass in config.inc.php

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered Oct 5, 2019 at 21:41

2

You might have made the same silly mistake that I did, by not removing the // making it a comment.

The line should be lượt thích this, but not as a comment.

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

answered Feb 11, 2013 at 14:30

I had a same problem, and I solved my problem.
First go to lớn config.default.php and change

$cfg['Servers'][$i]['AllowNoPassword'] = false;

to

$cfg['Servers'][$i]['AllowNoPassword'] = true;

answered Mar 25, năm ngoái at 9:48

I had the same problem. Edit config.inc.php didn't work, similary as reinstall phpmyadmin, apache or mysql. Only way is using password to lớn log in to lớn phpmyadmin.

How to lớn mix password:

  1. Do everything from below script:

sudo mysql_secure_installation

  1. Run:

sudo mysql

  1. Change authentication method of password for root and mix password:

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;

  1. Run:

mysql> FLUSH PRIVILEGES;

  1. exit mysql.

Now you can log to lớn phpmyadmin correctly.

answered Dec 9, 2021 at 20:50

Make sure you don't add or uncomment the AllowNoPassword option after the $i++ line.

/* Uncomment the following to lớn enable logging in to lớn passwordless accounts,
 * after taking note of the associated security risks. */

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

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered Jul 6, 2013 at 23:35

In ubuntu đôi mươi.04 and MYSQL 8.0.x I had the same problem and I tried to lớn allow PHPMyAdmin not to lớn using passwords.

  1. So for this you can open the config tệp tin by using this command:
sudo nano /etc/phpmyadmin/config.inc.php 
  1. Then use CTRL+w to lớn find $cfg['Servers'][$i]['AllowNoPassword'] in PHPMyAdmin`s config file:
/* Uncomment the following to lớn enable logging in to lớn passwordless accounts,
     * after taking note of the associated security risks. */
//$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  1. Uncomment the line by removing the // lượt thích this:
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  1. Use CTRL+o to lớn save the tệp tin and then CTRL+x to lớn exit from the tệp tin.

  2. After that restart the MySQL by this command:

sudo service mysql restart
  1. Try to lớn access PHPMyAdmin in your local http://127.0.0.1/phpmyadmin/

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered Jul 26, 2021 at 11:09

Just in tệp tin /etc/phpmyadmin/config.inc.php, uncomment or add the line(if not there),

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

It works just Awesome!

if you have any doubt restart apache.

sudo /etc/init.d/apache2 restart

Dharman

33.1k27 gold badges99 silver badges146 bronze badges

answered Jun 12, năm trước at 10:36

I have the same problem here, then I reinstalled mysql and it worked.

sudo apt-get install mysql-server mysql-common mysql-client

answered Nov 21, 2013 at 8:55

After a lot of trials I found the following solution.

This will work if you copied all phpmyadmin files in /var/www

go to lớn your copied location of phpmyadmin thư mục in /var/www

copy the config.sample.inc.php tệp tin as config.inc.php

edit in config.inc.php the following line:

$cfg['Servers'][$i]['AllowNoPassword'] = true;

(In original tệp tin it was false, change it as true and save it.)

Then you will be able to lớn login phpmyadmin without password.

mmohab

2,3734 gold badges27 silver badges43 bronze badges

answered Jun 27, năm trước at 18:56

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

yes the above answer is correct, but it's not secure, you can login root user directlyinto phpMyAdmin.

If you want to lớn create new user with password and give grant permission, execute the below command in MySQL on terminal, Login into your server on terminal,

  # mysql

 mysql> GRANT ALL PRIVILEGES ON *.* TO  'user-name'@'%'  IDENTIFIED BY  'password'   REQUIRE NONE WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;

zheek

7521 gold badge11 silver badges22 bronze badges

answered Jul 23, năm ngoái at 9:34

For mạ I had to lớn mix the auth type to lớn config in addition to lớn the setting the allow no password option in the config.inc.php tệp tin.

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

answered Mar 25, 2021 at 23:46

Others may find, as I did, (working in OS X 10.10.1) that the situation for MAMP PRO (at least in the current release, 3.0.7.3, is different.

All my attempts to lớn apply the remedies suggested here failed. Upon examining the PHP error log I discovered that the index.php that is operating (in /Libary/Application Support/appsolute/MAMP PRO/index.php -- at line 43, is deciding NOT to lớn go to lớn the config.inc.php that is discussed here (at /Applications/MAMP/bin/phpMyAdmin/config.inc.php) but rather to lớn /Library/Application Support/appsolute/MAMP PRO/phpMyAdmin/config.inc.php.

Furthermore, there is no such tệp tin there (after a 'successful' install of MAMP PRO), so sánh I'm stuck with the error, and furtherfuthermore, every time I try to lớn put the correct tệp tin there, when I restart MAMP PRO, it is not there anymore - something is automatically refreshed to lớn eliminate the config.inc.php I'm putting there. My workaround for now is to lớn vì thế this in MAMP instead of MAMP PRO.

Fluffeh

33.5k16 gold badges68 silver badges80 bronze badges

answered Jan 4, năm ngoái at 2:37

I had to lớn install MariaDB. I am using OpenSUSE LINUX Leap 15 and had to lớn execute these commands:

sudo zypper update
sudo zypper install mariadb mariadb-client mariadb-tools
sudo systemctl start mysql
sudo systemctl enable mysql //enable tự động start at boot time3
sudo mysql_secure_installation

Source.

answered Oct 18, 2018 at 9:46

It works; just thought this would be helpful to lớn someone in the future.

If you are working with MAMP, as a security measure, the $cfg['Servers'][$i]['AllowNoPassword'] = true; usually will be missing in the config.inc.php tệp tin so sánh if you want to lớn use phpMyAdmin without a password for root then simply add it preferably after the $cfg['Servers'][$i]['AllowDeny']['rules'] = array(); statement.

Then Restart your server just to lớn be sure and you will be good to lớn go.

answered Nov 6, 2018 at 14:35

After lots of struggle I found here you go:

  1. open thư mục -> xampp
  2. then open -> phpmyadmin
  3. finally open -> config.inc
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
  1. Put SHA256 inside single quotations lượt thích this one

830bbca930d5e417ae4249931838e2c70ca0365044268fa0ede75e33aff677de

$cfg['blowfish_secret'] = '830bbca930d5e417ae4249931838e2c70ca0365044268fa0ede75e33aff677de
';

I found this when I was downloading updated version of phpmyadmin. I wish this solution help you.

answered Feb 10, 2021 at 12:17

My problem was in config.inc.php changed to lớn

answered Mar 12, 2021 at 3:26

vim /etc/phpmyadmin/config.inc.php

or

sudo -H gedit /etc/phpmyadmin/config.inc.php

uncomment this below line

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

Then, exit and save the tệp tin using the following command,

:wq

answered Apr 14, 2021 at 8:44

Hello I had the same problem and I did not work as discussed in this post and was using the MAMP service, but then I noticed that at the bottom of the local page is the username and password in my case for both was root.

Fedor

20.7k34 gold badges53 silver badges160 bronze badges