How to login without password in phpMyAdmin

You will get the below error when logging in to phpMyAdmin without password even if your actual MySQL account is passwordless. This is because phpMyAdmin is normally configured to disable passwordless login due to security reasons.

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


To enable passwordless MySQL login in phpMyAdmin, you'll need to set AllowNoPassword option in phpMyAdmin's configuration to TRUE.

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