How to login without password in phpMyAdmin

It's normal for a development machine to have paswordless root login for MySQL. phpMyAdmin however is by default set to not allow that.

If disabled, you'll get the following error when trying to log in without entering the password;

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


To enable passwordless MySQL root login via phpMyAdmin, you'll need to set AllowNoPassword option in phpMyAdmin's configuration to TRUE. The configuration file could be in different location, depending on your platform.


To enable the option, uncomment or add the following line;

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

The line above need to be added twice; once within within the if (!empty($dbname)) { statement, and another one outside of it (probably towards the end of the configuration file).

It should be as the following example;

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

// other configuration options
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
comments powered by Disqus