Connection for controluser as defined in your configuration failed Phpmyadmin Xampp

If you are noticing Error messages in your phpMyAdmin eventually as follows :

error message

And are you unable to connect to your database, here is the simple resolution.

SOLUTION :

arrow_right Open config.inc.php which would be in location :

../xampp/phpmyadmin/config.inc.php

And search for keyword $cfg[‘Servers’][$i][‘controluser’] which in my instance is:
$cfg[‘Servers’][$i][‘controluser’] = ‘$pma’;

arrow_right Change the line to :
$cfg[‘Servers’][$i][‘controluser’] = ‘$root’;

replace-to-admin

 

 

 

That’s all you need to do. Restart Apache and MySQL. And Your phpMyAdmin is back in Action.

Advertisements

26 responses to “Connection for controluser as defined in your configuration failed Phpmyadmin Xampp

      • <?php
        /**
        * Debian local configuration file
        *
        * This file overrides the settings made by phpMyAdmin interactive setup
        * utility.
        *
        * For example configuration see
        * /usr/share/doc/phpmyadmin/examples/config.sample.inc.php
        * or
        * /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php
        *
        * NOTE: do not add security sensitive data to this file (like passwords)
        * unless you really know what you're doing. If you do, any user that can
        * run PHP or CGI on your webserver will be able to read them. If you still
        * want to do this, make sure to properly secure the access to this file
        * (also on the filesystem level).
        */

        // Load secret generated on postinst
        include('/var/lib/phpmyadmin/blowfish_secret.inc.php');

        // Load autoconf local config
        include('/var/lib/phpmyadmin/config.inc.php');

        /**
        * Server(s) configuration
        */
        $i = 0;
        // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
        // You can disable a server config entry by setting host to ''.
        $i++;

        /**
        * Read configuration from dbconfig-common
        * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
        */
        if (is_readable('/etc/phpmyadmin/config-db.php')) {
        require('/etc/phpmyadmin/config-db.php');
        } else {
        error_log('phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php.'
        . ' Check group www-data has read access.');
        }

        /* Configure according to dbconfig-common if enabled */
        if (!empty($dbname)) {
        /* Authentication type */
        $cfg['Servers'][$i]['auth_type'] = 'cookie';
        /* Server parameters */
        if (empty($dbserver)) $dbserver = 'localhost';
        $cfg['Servers'][$i]['host'] = $dbserver;

        if (!empty($dbport) || $dbserver != 'localhost') {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
        }
        //$cfg['Servers'][$i]['compress'] ='true';
        /* Select mysqli if your server has it */
        $cfg['Servers'][$i]['extension'] = 'mysqli';
        /* Optional: User for advanced features */
        $cfg['Servers'][$i]['controluser'] = '$pma';
        $cfg['Servers'][$i]['controlpass'] = '';
        $cfg['Servers'][$i]['password'] = '';
        /* Optional: 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';
        $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
        $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
        $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
        $cfg['Servers'][$i]['AllowNoPassword'] = 'true';

        /* Uncomment the following to enable logging in to passwordless accounts,
        * after taking note of the associated security risks. */
        // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

        /* Advance to next server for rest of config */
        $i++;
        }

        /* Authentication type */
        //$cfg['Servers'][$i]['auth_type'] = 'cookie';
        /* Server parameters */
        //$cfg['Servers'][$i]['host'] = 'localhost';
        //$cfg['Servers'][$i]['connect_type'] = 'tcp';
        //$cfg['Servers'][$i]['compress'] = false;
        /* Select mysqli if your server has it */
        //$cfg['Servers'][$i]['extension'] = 'mysql';
        /* Optional: User for advanced features */
        // $cfg['Servers'][$i]['controluser'] = 'pma';
        ///$cfg['Servers'][$i]['controlpass'] = 'pmapass';
        /* Optional: Advanced phpMyAdmin features */
        // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
        //$c/fg['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';
        // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
        /* Uncomment the following to enable logging in to passwordless accounts,
        / * after taking note of the associated security risks. */

        /*
        * End of servers configuration
        */

        /*
        * Directories for saving/loading files from server
        */
        $cfg['UploadDir'] = '';
        $cfg['SaveDir'] = '';

    • Hello Isay,
      I think you didn’t got the solutions properly.
      You only need to do the necessary changes in the file name “config.inc.php”, which would be in the directory of XAMPP i.e. “xampp/phpmyadmin/config.inc.php”
      Thanks . . .

  1. this is what i did that worked for me:
    when you locate the config.inc.php file open it and locate these below:
    /* User used to manipulate with storage */
    $cfg[‘Servers’][$i][‘controlhost’] = ‘localhost’; (- where i changed this to my host server)
    $cfg[‘Servers’][$i][‘controluser’] = ‘cognition’; (- I changed this to my server name)
    $cfg[‘Servers’][$i][‘controlpass’] = ‘xxxxxxxxxx’; (- i change this to my password)

    good luck guys

  2. Hello Experts,
    i have configure mysql and lampp on my linux….all works fine like http://localhost and http://localhost/phpmyadmin …..i changed the phpmyadmin/config.inc.php also for accepting password for the root i specified during mysql secure installtion.
    problem is i create a file db.php in lampp and write only one line of code to connect with mysql
    i.e mysql_connect(“localhost”,”root”,”sach”);
    which is giving me error

    Warning: mysql_connect(): No such file or directory in /opt/lampp/htdocs/hellophp/index.php on line 2

    and i could not connect it..although this line works fine in windows…phelp…

  3. hi it doesnt work to me , and i dont know how to start the question…
    ok this is what i ve done
    i installed xampp in e:\xampp in windows 7
    whwn i clicked admin apache my browser still want to open it
    but in browser i clicked php my admin it is written like this
    “#2002 – The server is not responding (or the local MySQL server’s socket is not correctly configured) ” and as you mentioned in title
    so i wrote what you said but still doesn’t work
    please how do i have to do for this situation?
    when i uninstalled my xampp mysqld cant be deleted, it said something about ” this file still used by other application ”
    so i reinstalled it but nothing changed
    sorry for this long text
    would you give me a clue?

    • Okay, this is not the solution as the your Error code is different. Lets try to solve this :
      1. Check your mysql default port is 3306 or not.
      2. Add the following code to config.inc.php in /xampp/phpMyAdmin :L
      $cfg[‘Servers’][$i][‘socket’] = ‘/var/run/mysql/mysql.sock’;
      or
      $cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;

      I would recommend to install XAMPP with default settings and path.
      Let me know the status….

      • I have tried everything
        /* Authentication type and info */
        $cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
        $cfg[‘Servers’][$i][‘user’] = ‘root’;
        $cfg[‘Servers’][$i][‘password’] = ”;
        $cfg[‘Servers’][$i][‘extension’] = ‘mysql’;
        $cfg[‘Servers’][$i][‘AllowNoPassword’] = true;
        $cfg[‘Lang’] = ”;

        /* Bind to the localhost ipv4 address and tcp */
        $cfg[‘Servers’][$i][‘host’] = ‘localhost’;
        $cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;

        /* User for advanced features */
        $cfg[‘Servers’][$i][‘controluser’] = ‘root’;
        $cfg[‘Servers’][$i][‘controlpass’] = ”;

        and this is my current status in config file but still, i’m getting the issue of ‘Connection for controluser as defined in your configuration failed’.i’m using mysql at port 3308 and it’s running but still, i’m unable to login in mysql admin.
        please help me.

  4. hi again
    i think it is putted in it already there
    $cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
    but
    $cfg[‘Servers’][$i][‘socket’] = ‘/var/run/mysql/mysql.sock’;
    it isnt there
    so do i have to replace the first code to second code
    or
    i have to write them both in
    and thak you for reply

    • Okay, try to add the first code in the file :
      $cfg[‘Servers’][$i][‘socket’] = ‘/var/run/mysql/mysql.sock’;
      dont replace anything.
      – Clear cache
      – Restart your Server
      I have also noticed, sometimes standalone MySQL installation binds the port 3306 this may conflict with our XAMPP, so check whether your XAMPP installation has default port or not i.e 3306 for MySQL.
      All the best. (:

      • sorry for not to mentioned in early
        the port is right 3306 and apache 80
        and i wrote them both
        and here it is

        $cfg[‘Servers’][$i][‘auth_type’] = ‘config’;
        $cfg[‘Servers’][$i][‘host’] = ‘localhost’;
        $cfg[‘Servers’][$i][‘socket’] = ‘/var/run/mysql/mysql.sock’;
        $cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
        $cfg[‘Servers’][$i][‘compress’] = false;
        $cfg[‘Servers’][$i][‘user’] = ‘root’;
        $cfg[‘Servers’][$i][‘password’] = ”;
        $cfg[‘Servers’][$i][‘extension’] = ‘mysql’;
        $cfg[‘Servers’][$i][‘AllowNoPassword’] = true;


        and i had written somebody tell me to use value”pma” in “user”
        but anything else are the same
        oh god i dont know anymore

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s