Can anyone confirm that phpMyAdmin AllowNoPassword works with MySQL databases?
Asked Answered
F

22

72

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.

Foldaway answered 6/5, 2011 at 8:27 Comment(2)
Checks if mysql is running, D'oh!Jonathanjonathon
This works for me immediatley in CentOS 7, but not CentOS 6. Can't figure it out :(. PS: It would be nice if we knew the OS you were on!, but its a little late lolPfaff
O
142
  1. Copy config.sample.inc.php to 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
  2. If you are trying to log in as root, you should have the following lines in your config:

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

Onetoone answered 6/5, 2011 at 8:37 Comment(5)
In CentOS 7: /etc/phpMyAdmin/config.inc.phpManufacture
this should be added in two places according to this: docs.oseems.com/general/web/phpmyadmin/… and it should be $cfg['Servers'][$i]['AllowNoPassword'] = true; NOT $cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;Edmondo
I'm going to check the obvious first and ask if you remembered to copy your config.sample.inc to config.inc. ??? Why to make config.php ? There is alread config,inc.phpSimeon
nothing worked for me then i followed this document and changed password of root. digitalocean.com/community/tutorials/…Tetracaine
In manjaro/Arch, the file will be located under /etc/webapps/phpmyadmin/config.inc.phpSemicircle
E
10

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;
Edmondo answered 30/1, 2015 at 3:31 Comment(0)
R
7

I tested the statement:

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

It did not work out for me.

Instead

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

worked.

Thanks!

Rigorous answered 17/6, 2014 at 18:38 Comment(1)
error clearly states AllowNoPassword needs to be true not AllowNoPasswordRoot. but documentation doesn't mention this. setting AllowNoPassword to true works indeed.Quagmire
R
5

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

Recapitulate answered 5/10, 2019 at 21:41 Comment(2)
thanks but the first part is sufficent , why the second part?Bunkhouse
if you're on localhost and want to save some time, but it's not working either these days, I 've deleted the outdated phpMyAdmin... now I'm using DBeaver instead.Recapitulate
T
4

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;
Thermosetting answered 11/2, 2013 at 14:30 Comment(0)
M
3

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;
Mythologize answered 6/7, 2013 at 23:35 Comment(0)
D
3

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!!!

Delphine answered 12/6, 2014 at 10:36 Comment(0)
S
3

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;
Swetlana answered 25/3, 2015 at 9:48 Comment(1)
where is config.default.php?Medick
G
3

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 log in to phpmyadmin.

How to set password:

  1. Do everything from below script:

sudo mysql_secure_installation

  1. Run:

sudo mysql

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

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

  1. Run:

mysql> FLUSH PRIVILEGES;

  1. exit mysql.

Now you can log to phpmyadmin correctly.

Gerlach answered 9/12, 2021 at 20:50 Comment(0)
H
2

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

sudo apt-get install mysql-server mysql-common mysql-client
Habit answered 21/11, 2013 at 8:55 Comment(0)
S
2

login without a password is forbidden by configuration (see allownopassword)

In ubuntu 20.04 and MYSQL 8.0.x I had the same problem and I tried to allow PHPMyAdmin not to using passwords.

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

  2. After that restart the MySQL by this command:

sudo service mysql restart
  1. Try to access PHPMyAdmin in your local http://127.0.0.1/phpmyadmin/
Scyros answered 26/7, 2021 at 11:9 Comment(0)
S
1

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.

Shamekashameless answered 27/6, 2014 at 18:56 Comment(0)
E
1
$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;
Episcopate answered 23/7, 2015 at 9:34 Comment(0)
B
1

For me I had to set the auth type to config in addition to the setting the allow no password option in the config.inc.php file.

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
Bellicose answered 25/3, 2021 at 23:46 Comment(0)
L
0

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.

Lamrert answered 4/1, 2015 at 2:37 Comment(0)
D
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.

Dime answered 18/10, 2018 at 9:46 Comment(0)
P
0

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.

Photoflood answered 6/11, 2018 at 14:35 Comment(0)
A
0

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

Attila answered 10/2, 2021 at 12:17 Comment(0)
S
0

My problem was in config.inc.php <? changed to <?php

Snifter answered 12/3, 2021 at 3:26 Comment(0)
C
0
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 file using the following command,

:wq
Cherlynchernow answered 14/4, 2021 at 8:44 Comment(0)
M
0

In addition to https://mcmap.net/q/273298/-can-anyone-confirm-that-phpmyadmin-allownopassword-works-with-mysql-databases In CentOS7, user 'apache' runs httpd, thus make sure user 'apache' has permission to read /etc/phpMyAdmin/config.inc.php.

Merri answered 2/2, 2023 at 5:13 Comment(0)
A
-1

According to this: https://drgamerss.blogspot.com/2024/01/how-to-login-without-password-in.html

Recently i have solve the same issue after watching many tutorials Just copy and paste the config.inc.php file from above and paste it in your file now you are able log in with the root username and press on Go button.

In case

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;
Azerbaijan answered 14/1, 2024 at 14:19 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Iden

© 2022 - 2025 — McMap. All rights reserved.