xampp localhost phpmyadmin Access denied for user 'root'@'localhost' (using password: YES)

88,750

Solution 1

Don't change anything , put as it was there , just open your xampp and try to access mysql from shell cd c://xampp/mysql/bin after this write mysql and click enter it will open your databases

Solution 2

try these step

  1. Open config.inc.php file in the phpmyadmin directory

  2. Find line 21: $cfg['Servers'][$i]['password'] = ''

  3. Change it to: $cfg['Servers'][$i]['password'] = 'your_password';

  4. Restart XAMPP

here is full description with image

Solution 3

After spending so much time what i came know is.

Just use this setting-> Open config.inc.php file in the phpmyadmin directory

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;  
$cfg['Lang'] = '';

You should have one user with @localhost host name. Now phpmyadmin will ask you for password. if you provide correct password,You will be able to login.

Solution 4

If the XAMPP->MySQL Port was changed, (default port is 3306) the new port must be added to the phpMyAdmin file:

xampp phpmyadmin access denied error(#2002)

C:\xampp\phpMyAdmin\config.inc.php

from:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
to :
$cfg['Servers'][$i]['host'] = '127.0.0.1:3308';

Solution 5

Change the following line under your config code from

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

to

$cfg['Servers'][$i]['password'] = '';
Share:
88,750
user979331
Author by

user979331

Updated on April 18, 2020

Comments

  • user979331
    user979331 about 4 years

    I am getting two errors when I try to go to my phpmyadmin localhost

    Access denied for user 'root'@'localhost' (using password: YES)
    
    phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
    

    I don't know what I am doing wrong...here is my config code...

    $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
    
    /* 
     * Servers configuration
     */
    $i = 0;
    
    /* 
     * First server
     */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'password';
    $cfg['Servers'][$i]['connect_type'] = 'socket'; 
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysql';
    /* User for advanced features */
    //$cfg['Servers'][$i]['controluser'] = 'pmauser';
    //$cfg['Servers'][$i]['controlpass'] = 'pmapass';
    /* Advanced phpMyAdmin features */
    //$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
    //$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    //$cfg['Servers'][$i]['relation'] = 'pma_relation';
    //$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    //$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    //$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    //$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    //$cfg['Servers'][$i]['history'] = 'pma_history';
    
    /* 
     * End of servers configuration
     */
    
    /*
     * Directories for saving/loading files from server
     */
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';
    
    ?>
    

    I notice a lot of code is commented out, should I un-commented it?

  • arkascha
    arkascha over 11 years
    You need the mysql client installed. It comes with a man page. But the general usage is: mysql -u <our-user-name> -p [RETURN]. If you want to access a database server on a different system you must make sure you have network access to the servers port, usually port 3306 for mysql. But as said: read the man page or the mysql documentation. It is all explained in there.
  • Broots Waymb
    Broots Waymb over 6 years
    Isn't this just access from the command line? Where does phpmyadmin fit into this?