phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

后端 未结 16 833
谎友^
谎友^ 2020-12-05 00:17

I keep getting the following errors with mysql connection through XAMPP and I don\'t know what to do:

That\'s the code in the config.inc.php



        
相关标签:
16条回答
  • 2020-12-05 00:31

    clear site data in your browser. and it will be fixed. sometimes when you run proxies, vpns or some other programs this error happens.

    0 讨论(0)
  • 2020-12-05 00:32

    if your port is 3307 (based on your port)

    Add this line in xampp\phpMyAdmin\config.inc: after i++

    $cfg['Servers'][$i]['port'] = '3307';
    
    0 讨论(0)
  • 2020-12-05 00:33

    Might be late to the party - also, this answer is for LAMP users who got to this thread from google, like me.

    Basically, the problem is PMA is trying to connect to SQL with a user that doesn't exist.

    At /etc/phpmyadmin/config-db.php, you will find 2 variables: $dbuser, and $dbpass. Those specify the MySQL user and Password that PMA is trying to connect with.

    Now, connect with some username/password that work (or just "root" if you are connecting from localhost), create a new user with global priviliges (e.g - %PMA User% with password %Some Random Password%), then in the above mentioned file set:
    $dbuser = %PMA User% ;
    $dbpass = %Some Random Password%;

    You might also change other stuff there, like the server address ($dbserver), the port ($dbport, which might not be the default one on your machine), and more.

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

    Linux / Ubuntu: If installed phpmyadmin via apt: sudo apt-get install phpmyadmin php-mbstring

    Can check /etc/phpmyadmin/config-db.php for changing the user credentials.

    $dbuser='pma';
    $dbpass='my_pass';
    $basepath='';
    $dbname='phpmyadmin';
    $dbserver='localhost';
    $dbport='3306';
    $dbtype='mysql';
    
    0 讨论(0)
  • 2020-12-05 00:36

    consider changing host entry 127.0.0.1 to localhost or even the IP address of the server.

    $cfg['Servers'][$i]['host']
    
    0 讨论(0)
  • 2020-12-05 00:37

    Add this line to the file xampp\phpMyAdmin\config.inc:

    $cfg['Servers'][$i]['port'] = '3307';
    

    Here, my port is 3307, you can change it to yours.

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