# phpmyadmin login problem

## codezero

I installed phpmyadmin but i can't login when i browse to http://localhost/phpmyadmin . It asks me for a username and a password. Is this the password for the mysql user (=root)?

Apache PHP and MySQL work perfectly. I 've edited the phpmyadmin configuration file located at /var/www/localhost/htdocs/phpmyadmin/config.inc.php. 

Here are some variables of the config file:

```

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

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

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

$cfg['Servers'][$i]['connect_type']  = 'tcp';

$cfg['Servers'][$i]['compress']      = FALSE;

$cfg['Servers'][$i]['controluser']   = 'pma';

$cfg['Servers'][$i]['controlpass']   = '5304157812566919175';

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

$cfg['Servers'][$i]['user']          = 'root';

$cfg['Servers'][$i]['password']      = 'mydatabasepassword';                        //edited

$cfg['Servers'][$i]['only_db']       = 'mydatabase';                                       //edited

```

So i tried to login as root with the password mydatabasepassword but I still can't login.

Any suggestions?

Thank you!

----------

## benjamin200

```

I installed phpmyadmin but i can't login when i browse to http://localhost/phpmyadmin . It asks me for a username and a password. Is this the password for the mysql user (=root)? 

```

Yes, but not for the unix root, it means the root password which include in mysql. Have you set it up before?

----------

## j-m

OK, a few tips.

Use "cookie" authentication, not http.

Use "socket", not tcp. 

Don´t put any password in, except for PMA. It is not needed when using cookies.

----------

## eerok

I'm having the same problem.  I followed j-m's advice and got this error:

Fatal error: mcrypt_decrypt(): Mcrypt initialisation failed in /var/www/localhost/htdocs/phpmyadmin/libraries/mcrypt.lib.php on line 90

It's possible I need to emerge something?

edit: solved that by providing a value for $cfg['blowfish_secret']

New problem: logging in as a non-root user who belongs to mysql.

--

----------

## j-m

This is 100% working config used for webhosting of many domains:

```

$cfg['PmaAbsoluteUri'] = 'http://www.example.com/phpmyadmin';

$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;

$cfg['blowfish_secret'] = '12345678901234567890';

$cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP address

$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port

$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket

$cfg['Servers'][$i]['connect_type']  = 'socket';       // How to connect to MySQL server ('tcp' or 'socket')

$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')

$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection

                                                    // (requires PHP >= 4.3.0)

$cfg['Servers'][$i]['auth_type']     = 'cookie';      // Authentication method (config, http or cookie based)?

$cfg['Servers'][$i]['user']          = '';      // MySQL user

$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed

                                                    // with 'config' auth_type)

$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only

                                                    // this db is displayed in left frame

                                                    // It may also be an array of db-names, where sorting order is relevant.

$cfg['Servers'][$i]['verbose']       = '';          // Verbose name for this host - leave blank to show the hostname

/**

* set these only if you are actually using PMA

* not needed

* leave all other at default settings

** /

$cfg['Servers'][$i]['controluser']   = 'pma';       // MySQL control user settings

                                                    // (this user must have read-only

$cfg['Servers'][$i]['controlpass']   = 's0mep4ssh3r3';

$cfg['Servers'][$i]['pmadb']         = 'pmadb';     // Database used for Relation, Bookmark and PDF Features

                                                    // (see scripts/create_tables.sql)

```

 *eerok wrote:*   

> 
> 
> New problem: logging in as a non-root user who belongs to mysql.
> 
> --

 

All users need USE privilege for mysql DB, otherwise I need more information if this is not the problem.

----------

## eerok

Thanks, j-m.  I got it working by fixing the user/pass for pma.

I saved that config for future use, since it's short and sweet  :Smile: 

--

----------

