mysql said: Cannot connect: invalid settings. xampp

前端 未结 19 1144
闹比i
闹比i 2020-12-01 00:11

I changed the root password to test and now I cannot login in phpMyAdmin page in XAMPP. I looked for help here and here which basically says changed config.inc.php

相关标签:
19条回答
  • 2020-12-01 00:26

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

    if u change port address

    0 讨论(0)
  • 2020-12-01 00:34

    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.

    0 讨论(0)
  • 2020-12-01 00:36

    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

    0 讨论(0)
  • 2020-12-01 00:37

    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.

    0 讨论(0)
  • 2020-12-01 00:37

    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:

    • Reset mysql root password

    • MAMP Doco to change root password

    0 讨论(0)
  • 2020-12-01 00:40

    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.

    0 讨论(0)
提交回复
热议问题