[mysql] phpMyAdmin - can't connect - invalid setings - ever since I added a root password - locked out

I run XAMPP, a few days back i had set up a password for the root password through phpmyadmin I am not able to access phpMyAdmin ever since that moment

I followed help on this link but everything seems fine there (in config.inc.php). I even tried unistalling xampp fully, restarting windows and then reinstalling xampp, but still pointing to localhost/phpmyadmin I get the following error

MySQL said: 
Cannot connect: invalid settings. 
phpMyAdmin tried to connect to the MySQL server, and the server rejected the
connection. You should check the host, username and password in your
configuration and make sure that they correspond to the information given
by the administrator of the MySQL server.

I Also tried to reset root password through mysqld.bat as given on mysql's website help but to no avail

Please Help! Here's a screenshot describing the situation: enter image description here

This question is related to mysql phpmyadmin root

The answer is


This works for me:

C:\xampp\phpMyAdmin\config.inc.php

$cfg['Servers'][$i]['password'] = 'secret';

Edit: Before you got this error it is most likely that from phpmyadmin->Users you have added password for the root user. In my case that was "secret" so the above primer works for me BUT for you will work this:

$cfg['Servers'][$i]['password'] = 'Enter the password for root you have added before you got this error';

1) Go to your Xampp Root folder

For Ex : C:xampp/phpmyadmin/config.inc.php

2) In that find the following :

$cfg['servers'][$i]['password'] = '';

3) Here enter which password you set.

Ex : $cfg['servers'][$i]['password'] = '1234';

4) Then Save it and Restart your Xamp server.


I had this same problem using the Windows XAMPP 1.7.4 -- after setting a password for mysql, I could no longer access phpMyAdmin. I changed the password in config.inc.php from ' ' to the new mysql password, and changed AllowNoPassword from true to false. I still couldn't log in.

However, I saw that there is also a config.inc.php.safe file, and when I also edited the password settings in THAT file I was subsequently able to log in to phpMyAdmin.


I had a similar problem not being able to access phpmyadmin on a testing server after changing the root password. I tried everything mentioned above, including advice from other forums, using all kinds of variations to the config files. THEN I remembered that Google Chrome has some issues working with a testing server. The reason is that Chrome has a security feature to prevent local hard drive access from a remote website - unfortunately this can cause issues in a testing environment because the server is a local hard drive. When I tried to log in to phpmyadmin with Internet Explorer it worked fine. I tried several tests of Chrome v IE9, and Chrome would not work under any configuration with the root password set. I also tested Firefox it also worked fine, the issue is only with Chrome. My advice: if you're on a testing server make sure your config file has the correct settings as described above, but if the problem continues and you're using Chrome try a different browser.


Apply these changes in phpmyconfig/config.inc. Type in your username and password that you have set:

$cfg['Servers'][$i]['user']                 = 'user';
$cfg['Servers'][$i]['password']             = 'password';
$cfg['Servers'][$i]['AllowNoPassword']      = false;

This works for me.


I'm one of the noob too when I encountered something like this. So... I set the passwords using the command security page gave me: /opt/lampp/lampp security Then I used password xyz for all the passwords... Then when I go to site/, it ask for a basic authentication. But when I tried root//xyz, it does not allow me login. So, after some digging, it turns out the xyz password was set for a default user named 'lampp'. When I tried to login using lampp//xyz, it worked like a charm.

The issue is that they made an assumption that everyone knows to use lampp//rootpw as their login o.O And... that is a basic auth for the directory! not pw for phpmyadmin or pw for mysql...


For AMPPS, I have to add this is my phpMyAdmin/config.inc.php

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

Note: In Ubuntu, I had to locate where the file is and I used locate config.inc.php

This answer is only meant for local, development purposes :)


I had similar problem. Difference was that I was getting this error for only one database out all my databases. I removed the password , restarted mysql many times and still it dint work :(

And when I cleared the cache of my browser it just started working !!!

This one really screwed my mind !


Step 1: Go to

http://localhost/security/xamppsecurity.php

Step 2: Set/Modify your password.

Step 3: Open C:\xampp\phpMyAdmin\config.inc.php using a editor.

Step 4: Check the following lines:

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'your_password';

// your_password = the password that you have set in Step 2.

Step 5: Make sure the following line is set to TRUE: $cfg['Servers'][$i]['AllowNoPassword'] = true;

Step 6: Save the file, Restart MySQL from XAMPP Control Panel

Step 7: Login into phpmyadmin with root & your password.

Note: If again the same error comes, check the security page:

http://localhost/security/index.php

It will say: The MySQL admin user root has no longer no password SECURE
PhpMyAdmin password login is enabled. SECURE

Then Restart your system, the problem will be solved.


For any ubuntu users visiting this page, I was facing the same error and the issue was XAMPP (LAMPP in ubuntu) was not able to connect to mysql because another mysql service was working so my solution to this issue was

stop mysql service

sudo service mysql stop

restart lampp

sudo /opt/lampp/lampp restart

I faced the same problem after executing the following command in mysql

UPDATE mysql.user SET Password=PASSWORD('blablabla') WHERE User='root'; FLUSH PRIVILEGES;

what I did:

open cmd

type

cd c:\xampp\mysql\bin mysql.exe -u root --password

after that mysql will prompt u

Enter password:blablabla

once youre in mysql, type

UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root'; FLUSH PRIVILEGES;

Note: this time the password is left empty...

make sure in your config.inc.php the following is set

$cfg['Servers'][$i]['password'] = '';

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

after that I can see my phpmyadmin...


PHPMYADMIN - Cannot connect: invalid settings.

I also faced similar issue but now I found a fix.

For wamp server:

IN: C:\wamp\apps\phpmyadminVERSION\config.inc.php

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

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

For xampp server:

because of xampp server had the following settings.

C:\xampp\phpMyAdmin\config.inc.php

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

$cfg['Servers'][$i]['password'] = ''; // which is default setting in xampp server

$cfg['Servers'][$i]['password'] = 'your password';//type your password you have changed

Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to phpmyadmin

phpMyAdmin on MySQL 8.0 phpmyadmin - count(): Parameter must be an array or an object that implements Countable Error loading MySQLdb Module 'Did you install mysqlclient or MySQL-python?' phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY000/2002): No such file or directory How to create a foreign key in phpmyadmin #1292 - Incorrect date value: '0000-00-00' MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine phpMyAdmin Error: The mbstring extension is missing. Please check your PHP configuration

Examples related to root

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' Connect to docker container as user other than root MySQL user DB does not have password columns - Installing MySQL on OSX vagrant login as root by default adb shell su works but adb root does not Android: adbd cannot run as root in production builds How to get domain root url in Laravel 4? Import Certificate to Trusted Root but not to Personal [Command Line] How to check if running as root in a bash script Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?