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

MysqlPhpmyadminRoot

Mysql Problem Overview


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

Mysql Solutions


Solution 1 - Mysql

Go inside your phpMyAdmin directory inside XAMPP installation folder. There will be a file called config.inc.php. Inside that file, find this line:

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

you must make sure that this field has your mysql root password (the one that you set).

Solution 2 - Mysql

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

Solution 3 - Mysql

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.

Solution 4 - Mysql

Step 1: Go to

http://localhost/security/xamppsecurity.php</pre>

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</pre>

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.

Solution 5 - Mysql

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.

Solution 6 - Mysql

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...

Solution 7 - Mysql

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 !

Solution 8 - Mysql

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.

Solution 9 - Mysql

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

Solution 10 - Mysql

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...

Solution 11 - Mysql

  1. Go to your Xampp Root folder

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

  1. In that find the following :

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

  2. Here enter which password you set.

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

  1. Then Save it and Restart your Xamp server.

Solution 12 - Mysql

> 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';

Solution 13 - 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 :)

Solution 14 - Mysql

This happened to me. The best way to solve is to go to computer>Local disk>xampp. Right click on the xampp folder and restore it to a previous date that worked. It worked perfectly for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionOrangeRindView Question on Stackoverflow
Solution 1 - MysqlPrasanna RaghuView Answer on Stackoverflow
Solution 2 - MysqlagilesView Answer on Stackoverflow
Solution 3 - MysqlTrevor AllsoppView Answer on Stackoverflow
Solution 4 - MysqlPrazView Answer on Stackoverflow
Solution 5 - Mysqlinteresting eyyView Answer on Stackoverflow
Solution 6 - MysqlsylverfistView Answer on Stackoverflow
Solution 7 - MysqlMuhammad RiyazView Answer on Stackoverflow
Solution 8 - MysqlsedanView Answer on Stackoverflow
Solution 9 - MysqlsumiView Answer on Stackoverflow
Solution 10 - MysqlGrant LiView Answer on Stackoverflow
Solution 11 - MysqlNisanthView Answer on Stackoverflow
Solution 12 - MysqlCombineView Answer on Stackoverflow
Solution 13 - MysqlWoppiView Answer on Stackoverflow
Solution 14 - MysqlbalogunView Answer on Stackoverflow