phpMyAdmin access denied for user 'root'@'localhost' (using password: NO)

前端 未结 15 1837
北海茫月
北海茫月 2021-02-01 06:18

I am unable to connect to my MySQL in xampp I have this error:

MySQL said: Documentation

1045 - Access denied for user \'root\'@\'localhost\'

相关标签:
15条回答
  • 2021-02-01 06:55

    You may had set different passwords for user 'root' or have been changed your password. I had same error as :

    mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

    and I found that my root password for phpmyAdmin is not same on both 'mysql' and 'phpmyadmin' databases, so I updated my password for 'phpmyadmin' database same as 'mysql' database as follow:

    sudo gedit /etc/phpmyadmin/config-db.php

    and update the fields

    $dbuser='root';

    $dbpass='myNewPassword'; <-- update your new password here

    Best wishes!

    0 讨论(0)
  • 2021-02-01 06:57

    When you install the WAMPP in your machine by default the password of PhpMyAdmin is blank. so put root in user Section and left blank of password field. hope it works.

    Happy Coding!!

    0 讨论(0)
  • 2021-02-01 06:58

    In case none of the aforementioned solutions works for you, then simply do the under changes. Change this

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

    to

    $cfg['Servers'][$i]['host'] = 'localhost';
    

    and

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

    to

    $cfg['Servers'][$I]['auth_type'] ='cookies';
    

    It works in my situation, possibly works on your situation also.

    0 讨论(0)
  • 2021-02-01 06:58

    Just do what the message is asking for, create the user pma@localhost in the phpMyAdmin panel with no password

    0 讨论(0)
  • 2021-02-01 06:59
    /* Authentication type and info */
    $cfg['Servers'][$i]['password'] = '';<----your password
    

    or

    /* User for advanced features */
    
    $cfg['Servers'][$i]['controluser'] = 'pma';
    
    $cfg['Servers'][$i]['controlpass'] = '';
    

    to

    /* User for advanced features */
    
    $cfg['Servers'][$i]['controluser'] = 'your user';
    
    $cfg['Servers'][$i]['controlpass'] = 'your password';
    
    0 讨论(0)
  • 2021-02-01 07:02

    This is the Different Solution, Check if your Services are running correctly, if WAMP icon showing orange color, and 2 out of 3 services are running it's showing, then this solution will work . Root cause:

    If in your system mysql was there, later you installed WAMP then again one MYSQL will install as WAMP package, default port for MYSQL is 3306 , So in both mysql the port will be 3306, which is a port conflict, So just change the port it will work fine. Steps to change the Port.

    1. Right click the WAMP icon.
    2. Chose Tool
    3. Change the port in Port used by MySql Section
    0 讨论(0)
提交回复
热议问题