Changed password in phpMyAdmin on a Mac using XAMPP, now unable to access localhost/phpmyadmin

前端 未结 3 807
天命终不由人
天命终不由人 2021-01-22 08:02

I\'ve read all the posts I could find about this, and none helped. I\'ve deleted the XAMPP folder from my computer and reinstalled it from the DMG file, which of course fixed th

相关标签:
3条回答
  • 2021-01-22 08:25

    In your main installation folder for phpMyAdmin, you must have made a config.inc.php file, that is the file that you should be changing. Incase you don't have that file, then create it:

    In the main installation folder(pMA) you would already have a file named: config.sample.inc.php, which contains the default configurations. Make a copy of this file and rename it to config.inc.php, you can do that directly using cp command (after navigating into the said folder):

    cp ./config.sample.inc.php ./config.inc.php
    

    Now make a few changes to this new file:

    1. Change the entry $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1'; (as it does not work in some places)
    2. Write/change this line: $cfg['Servers'][$i]['AllowNoPassword'] = false;

    Note: by the main installation folder for phpMyAdmin i mean the root folder of the installation of phpMyAdmin, i.e /<abc>/<xyz>/phpMyAdmin/.
    Also make the 2nd change first, and make the 1st change only if the host is not found

    0 讨论(0)
  • 2021-01-22 08:25

    Inside \xampp\phpmyadmin\config_inc.php

    add or change like following code.
    $cfg['Servers'][$i]['auth_type'] = 'cookie';

    after that try to clear browsing data. then restart mysql.
    It works for me. Hope it may help you.

    0 讨论(0)
  • 2021-01-22 08:37

    Although, @bool dev have provided an answer above. I would like to share my version of how i resolved this using the terminal. I am using 10.12.5 (OS Serria)

    Firstly, you need to have root access

    sudo su
    

    Then go to root folder

    cd /
    

    From there you need to navigate to the phpMyAdmin folder

    cd Applications/XAMPP/xamppfiles/phpmyadmin/
    

    Then using any editor open the config.inc.php file. (I used vi)

    vi config.inc.php
    

    Go to the following section in the file

    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = ''; // This is empty, set your password here
    

    Then just restart your MySql server. And viola it should be working now.

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