mysql said: Cannot connect: invalid settings. xampp

浪子不回头ぞ 提交于 2019-11-28 04:29:05
sohrab

I have been confronted with the same problem, so I went to :

/xampp/phpmyadmin/config.inc.php

I pasted the password which I had enter earlier then I was able to access phpmyadmin again, there in the privileges tab/ edit/ I chose no password and go then it all came back to life :)

Also you can change the user to admin but your phpmyadmin would be in admin side and your other localhost website will not work either.

Alma

I also had the same problem and it tooks me several hours to figured out.

I just changed 'config' to 'cookie'

$cfg['Servers'][$i]['auth_type'] = 'config';
Hairul

Opsss. after I change user to 'admin', it doesn't have privelege to add database.. so I change back the user to 'root'.

Then I change the password from the browser.

  1. Go to http://localhost/security/ and then click on the link http://localhost/security/xamppsecurity.php . After that change pasword for superuser to 'root'.

  2. After that open your http://localhost/phpmyadmin/

    Now it works.

The above code fixed problem for most of the ppl but I still could not login. Finally I found this (line#9 in the above code needs to be changed)

$cfg['Servers'][$i]['AllowNoPassword'] = true;   <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false;  <--- to this fixed the problem.

Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.

I also faced the same problem it was because another mysql service was running and in parallel mysql in xampp i was trying to run. So you may check that out if other solutions don't work out. You can stop that by the following command:

sudo service mysql stop

May help few users.

$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';

if u change port address

Hairul

I also have the problem but now solved

$cfg['Servers'][$i]['user'] = 'admin'; - I change the user name from 'root' to 'admin'

Put generated password in config.inc.php if you changed root user password. I was repeatedly putting password that it asks in phpmyadmin and not generated password.

Being a noob in php and just starting out in xampp, I changed root user password and phpmyadmin has generate password button which generates password that's suppose to get updated in config.inc.php files line but it didn't so I manually updated it.

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

On the other hand, this might also help, it involves adding a line to resetroot.bat

all you have to do is stopping

mysqld.exe

from the task manager and restart the server (Xammp)

ElaGorilaki

I also had that problem and i did what hairul said:

  1. Go to localhost/security/
  2. Click the orange link localhost/security/xamppsecurity.php
  3. Change the password for superuser: 'root'"

then i restarted mysql on the xampp control panel and didn t work.

It only worked when i restarted my computer!!!!

I faced this problem as well but i could fix it by going to the folder /xampp/phpmyadmin/config.inc.php

Open config.inc.php, u will find (if no password) ['password']= '' or (if old password) ['password']= '123'

Change the password $cfg['Servers'][$i]['password'] = 'test' and u will be able to access phpmyadmin again :)

it may be another mysqld instance running and stoped it with:

sudo service mysql stop

Worked for me.

Best Way is reinstall if you have xampp/wamp/mamp or in linux uninstall and reinstall phpmyadmin by using apt-get

Moxet Khan

I made changes to the config file for Laravel and completely forgot the changes. After applying everything from this thread, I had no success.

I simply overwrote the config.inc file from another xampp installation and it worked fine.

I'm using MAMP, but looks like the exact same issue.

I changed my root password via phpMyAdmin and got locked out as described. I saw this thread and tried to get it working with the new password but the config updates didn't seem to work for me.

I tried to revert, changed the root password back, but it wasn't working, so I hunted around to try and revert my password back to the original. Eventually I discovered that for some strange reason there were multiple root users, root@localhost, root@127.0.0.1, root@::1!

To get it back working basically I did this:

mysql -u root -p
mysql> use mysql;
mysql> update user set password=PASSWORD("root") where User='root';
mysql> flush privileges;
mysql> quit

After that I removed all the root users other than localhost (using phpMyAdmin), and I could still login... so, not sure why they were there in the first place.

Then, I discovered that MAMP Pro has a button under the MySQL tab that sets the root password. I'm not sure what files it edits, or services it restarts, etc... but it worked.

References:

if you are using google chrome you can fix the problem via , trying any one of the steps mentioned on this page but you need to clear your whole browsing history .... clear all the data that chrome saved onto your computer by pressing ctrl+h and the clearing all the browsing data select all the fields now restart php my admin and all will work

naren

If you are facing this issue after changing password in phpmyadmin, paste the old password (passwd before change) in xampp\phpMyAdmin\config.inc.php :

$cfg['Servers'][$i]['password'] = '**old password here**';

Hope, it would work :)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!