On a development server, at least once this situation occurs when the MySQL won’t set up with a root password.
- Login without a password is not allowed by configuration (see AllowNoPassword).
- Here we will be using Ubuntu 15.04 server, and logged in as root.
You will get an error as “Login without a password is forbidden by configuration (see AllowNoPassword)” as shown below:
You can easily enable the ability to manage MySQL via phpMyAdmin (when the root login has no password). It is as easy as changing two lines in the configuration file.
Let’s set the AllowNoPassword variable, included in phpMyAdmin’s configuration file, to TRUE. On an Ubuntu 18.04 LTS server, modify the below file:
Type in a forward slash “/” to start searching of the file. Type in “Allow” which will display the below line:
// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
Now, uncomment that line. For this, just remove the two forward slashes “//” at the start of the line. Also note that there are two instances of this line in the configuration file.
Ensure that you uncomment both!
Next, exit and save the file with the below command:
After making this change, and later re-adding a password to phpMyAdmin, you can any time go back in and re-comment these lines if you want to disable this setting. You can easily modify configuration settings like these to behave in the way you want because Linux addresses almost all files as flat files.