You will get the below error when logging in to phpMyAdmin without a password, even if your existing MySQL account itself is passwordless. It 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 login to MySQL / MariaDB with no password in phpMyAdmin, you'll need to configure AllowNoPassword option in phpMyAdmin's configuration.
Steps to allow no-password login to MySQL or MariaDB in phpMyAdmin:
- Make sure your MySQL or MariaDB user is passwordless and accessible by phpMyAdmin's system user.
User root by default requires system's administrator privilege to log in.
Related: How to access MySQL or MariaDB as root without using sudo - Open phpMyAdmin configuration file using your preferred text editor.
$ sudo vi /etc/phpmyadmin/config.inc.php
Related: phpMyAdmin configuration file
- Search for Servers → AllowNoPassword options and set the value to TRUE.
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
Remove // at the start of the line if exist to uncomment the option.
Depending on distributions, there could be multiple occurrences of that particular line. Ubuntu for example has the following 2 lines;
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;
- Save and exit the text editor.
- Log in again via phpMyAdmin without password.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.