I can't access XAMPP phpMyAdmin; it says: Error MySQL said: Documentation Cannot connect: invalid settings

34,870

Solution 1

I found the answer in StackOverflow. In "config.inc.php" file, I changed 'config' to 'cookie'. Here is the answer quoted from StackOverflow:

Step 1:

Locate phpMyAdmin installation path.

Step 2:

Open phpMyAdmin>config.inc.php in your favourite text editor.

Step 3:

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

Replace it with $cfg['Servers'][$i]['auth_type'] = 'cookie';

Solution 2

I found my own answer. Steps that I followed to solve this error in XAMPP are:

  1. Go to "C:\xampp\phpMyAdmin"
  2. Find the file named, "config.inc.php"
  3. Open this file in any text editor. (I used Sublime Text)
  4. Find the lines:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
  1. Provide your password here at the line:

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

  2. Restart the XAMPP services.

Your Problem will be solved

Share:
34,870
Brian
Author by

Brian

Updated on May 31, 2020

Comments

  • Brian
    Brian almost 4 years

    Full error message:

    Error
    MySQL said: Documentation
    Cannot connect: invalid settings. 
    Connection for controluser as defined in your configuration failed.
    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 have been using a web hosting site sever so far; this may have messed up my xampp connection. My phpMyAdmin "config.in.php" file is set up as follows:

    /* Authentication type and info */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Lang'] = '';
    
    /* Bind to the localhost ipv4 address and tcp */
    $cfg['Servers'][$i]['host'] = '127.0.0.1';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    

    I am able to run the php codes that I have created using xampp at "localhost:8080", but I can't access mysql. My database connection configuration is as follows:

    // Databse Connection Constants
    define('DB_HOST','localhost');
    define('DB_USER','root');
    define('DB_PASS',','');
    define('DB_NAME','gallery_db');
    

    Can anyone help? Thanks.

  • SteveTz
    SteveTz almost 3 years
    but I failed to login with user root with an empty password, I got the error Cannot log in to the MySQL server mysqli_real_connect(): (HY000/2002): Connection refused