[php] Can anyone confirm that phpMyAdmin AllowNoPassword works with MySQL databases?

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

I am trying to 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 file for phpMyAdmin I have set:

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

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

This question is related to php mysql apache passwords phpmyadmin

The answer is


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

The line should be like this, but not as a comment.

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

It works; just thought this would be helpful to 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 file so if you want to 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 be sure and you will be good to go.


I tested the statement:

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

It did not work out for me.

Instead

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

worked.

Thanks!


Yes not working! I spent whole day with this stupid phpMyAdmin. Just add a new user with a password

1 - Login to mysql or mariadb mysql -u root -p

2 - Run these SQL commands to 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 /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


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

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

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

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

to

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

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

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

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

After a lot of trials I found the following solution.

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

go to your copied location of phpmyadmin folder in /var/www

copy the config.sample.inc.php file as config.inc.php

edit in config.inc.php the following line:

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

(In original file it was false, change it as true and save it.)

Then you will be able to login phpmyadmin without password.


After lots of struggle I found here you go:

  1. open folder -> 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 like this one

830bbca930d5e417ae4249931838e2c70ca0365044268fa0ede75e33aff677de

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

I found this when I was downloading updated version of phpmyadmin. I wish this solution help you. enter image description here


Just in file /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

Cheers!!!


According to 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;

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 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 go to the config.inc.php that is discussed here (at /Applications/MAMP/bin/phpMyAdmin/config.inc.php) but rather to /Library/Application Support/appsolute/MAMP PRO/phpMyAdmin/config.inc.php.

Furthermore, there is no such file there (after a 'successful' install of MAMP PRO), so I'm stuck with the error, and furtherfuthermore, every time I try to put the correct file there, when I restart MAMP PRO, it is not there anymore - something is automatically refreshed to eliminate the config.inc.php I'm putting there. My workaround for now is to do this in MAMP instead of MAMP PRO.


$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 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;

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

sudo zypper update
sudo zypper install mariadb mariadb-client mariadb-tools
sudo systemctl start mysql
sudo systemctl enable mysql //enable auto start at boot time3
sudo mysql_secure_installation

Source.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to passwords

Your password does not satisfy the current policy requirements Laravel Password & Password_Confirmation Validation Default password of mysql in ubuntu server 16.04 mcrypt is deprecated, what is the alternative? What is the default root pasword for MySQL 5.7 MySQL user DB does not have password columns - Installing MySQL on OSX Changing an AIX password via script? Hide password with "•••••••" in a textField How to create a laravel hashed password Enter export password to generate a P12 certificate

Examples related to phpmyadmin

phpMyAdmin on MySQL 8.0 phpmyadmin - count(): Parameter must be an array or an object that implements Countable Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?' phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY000/2002): No such file or directory How to create a foreign key in phpmyadmin #1292 - Incorrect date value: '0000-00-00' MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration