# [phpmyadmin] Can not login

## capira

I have installed phpMyAdmin 2.7.0-pl2 into a clear gentoo box. Everything seems to be fine: no compilation problems and the webapp-config runs fine. I type http://localhost/phpmyadmin and I get a dialog asking me the user and the password. But i can not login! I have tried login with the mysql root user without any success.

Do I have to login with the 'pma' user? Does anybody know the default password for the 'pma' user?

-- some usefull information

This is the phpmyadmin/config.default.php

 *Quote:*   

> /**
> 
>  * Server(s) configuration
> 
>  */
> ...

 

Thanks in advance

--- Edited ---

Removed the "Sorry, I think I post in the wrong place", because seems I was wrong when I thought that I was wrong ... :S!Last edited by capira on Mon Feb 13, 2006 7:47 am; edited 2 times in total

----------

## Aries-Belgium

Have you set the root user's password?

----------

## capira

Do you mean the mysql root user? In that case, yes. I can connect to mysql through 'mysql -u root -p'. The odd thing is that before reinstalling I had got this app running fine. And do not remember doing other different things than emerging the app.

----------

## Aries-Belgium

Check the bind adress of your mysql server in my.conf.

You set the adress of the mysql server in you phpmyadmin config to localhost, so make sure the bind adress is 127.0.0.1.

----------

## capira

Thnaks for the tip, Aries-Belgium.

The bind address in the /etc/mysql/my.cnf file is set to 127.0.0.1. Seems that is not a problem with mysql.

----------

## mattmatteh

i cant log in with phpmyadmin either.  been trying for at least a day now.

removed it, reinstalled it, tried the creat.sql script

i can log in to the database from the shell fine   # mysql -p   and enter the passwd and i am in.

anyone get phpmyadmin to work?

is there a log file for this?  or a shot in the dark ?

matt

----------

## Aries-Belgium

Try to set this option in your config.inc.php

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

to:

```
$cfg['Servers'][$i]['auth_type'] = 'cookie';
```

And does phpmyadmin/mysql give an error message?

----------

## capira

Ok, Aries-Belgium, I have changed the auth type ... just this piece and I get this message

ERROR: The configuration file now need a secret passphrase (blowfish_secret)

I can assume that i could use this method instead of http (I can change it now, but I will in short), but the problem for me would be: why the http is not working when it was working fine before (as far I can remember)?

It is a odd thing :S

----------

## Aries-Belgium

 *capira wrote:*   

> Ok, Aries-Belgium, I have changed the auth type ... just this piece and I get this message
> 
> ERROR: The configuration file now need a secret passphrase (blowfish_secret)
> 
> 

 

Now you have to set the blowfish_secret in your config file.

```
$cfg['blowfish_secret'] = '< fill a word in here, it doesn't matter which one >';
```

 *capira wrote:*   

> 
> 
> I can assume that i could use this method instead of http (I can change it now, but I will in short), but the problem for me would be: why the http is not working when it was working fine before (as far I can remember)?
> 
> It is a odd thing :S

 

I have no idea why http security method isn't working anymore. I personally didn't use it yet. I use either "config" or "cookie".

----------

## JamesBong

Hi there, I think I have the same Problem. mysql seems to run fine. I am able to log in using command line. But while tryiing to login with phpmyadmin from localhost on localhost I get this msg:

 *Quote:*   

> #1045 - Access denied for user 'pma'@'localhost' (using password: YES)

 

I took these steps to get phpmyadmin to work:

-call 

```
 mysql -u root -p < /usr/share/webapps/phpmyadmin/2.7.0_p1/sqlscripts/mysql/2.7.0_p1_create.sql 
```

-changed the settings in config.inc.php to $cfg['Servers'][$i]['auth_type'] = 'cookie'; in the first section of the file

-delete /var/lib/mysql  and called 

```
ebuild /var/db/pkg/dev-db/mysql-4.1.14/mysql-4.1.14.ebuild config
```

 start mysql again, call

the creat.sql script again and no change.

I searched throught the forum but couldn't find a solution, that worked for me. Did I miss something?

Thanks for the help

----------

## capira

To Aries-Belgium: I did what you said but without any success. I got a 

```
#1045 - Access denied for user 'pma'@'localhost' (using password: YES)
```

 like JamesBong

I will try downgrading phpmyadmin ...

----------

## JamesBong

to capira will you please let me know if downgrade fixed the problem for you

----------

## capira

To James Bong, I have tried with the previous version (phpmyadmin-2.7.0_p1) without anysucces.

I have changed the confg.inc.php in this way:

```
$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']  = 'tcp';       // 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]['controluser']   = 'pma';       // MySQL control user settings

                                                    // (this user must have read-only

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

                                                    // access to the "mysql/user"

                                                    // and "mysql/db" tables).

                                                    // The controluser is also

                                                    // used for all relational

                                                    // features (pmadb)

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

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

$cfg['Servers'][$i]['password']      = 'rootPW';          // 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

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

                                                    // (see scripts/create_tables.sql)

                                                    //   - leave blank for no support

                                                    //     DEFAULT: 'phpmyadmin'

$cfg['Servers'][$i]['bookmarktable'] = 'PMA_bookmark';

                                                    // Bookmark table

                                                    //   - leave blank for no bookmark support

                                                    //     DEFAULT: 'pma_bookmark'

$cfg['Servers'][$i]['relation']      = 'PMA_relation';

                                                    // table to describe the relation between links (see doc)

                                                    //   - leave blank for no relation-links support

                                                    //     DEFAULT: 'pma_relation'
```

And now I am getting

```
 MySQL said: Documentation

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
```

But I can gain access to mysql through

```
mysql -u root  -p
```

Any idea?

----------

## Earthwings

 *Quote:*   

> -- SORRY! I think I post in the wrong place! This post should be in Portage and Programming. Could any mod move the post to the right thread? --

 As for the move to P&P, I think Networking & Security is ok as well, why do you think it should be in Portage & Programming? You can contact us through the report thread btw.

Why do you set connection_type to tcp? Try socket, which is the default (disclaimer: I only read the last post)

----------

## toralf

After getting in trouble with phpmyadmin I unmerged phpmyadmin, deleted manually its database from mysql , emerged phpmyadmin again, created the database as described by the ebuild msg.

At that point I could login into phpmyadmin but the icons on the left side were empty. After login and chosing a different database I got the login popup again. That's why I  copied the file config.default.pho to config.inc.php and changed the following, after that phpmyadmin works fine:

```
n22_uml /var/www/localhost/htdocs/phpmyadmin # diff -u config.default.php config.inc.php

--- config.default.php  2006-02-13 11:39:46.000000000 +0100

+++ config.inc.php      2006-02-13 11:57:20.000000000 +0100

@@ -28,7 +28,7 @@

  * test is to browse a table, then edit a row and save it.  There will be

  * an error message if phpMyAdmin cannot auto-detect the correct value.

  */

-$cfg['PmaAbsoluteUri'] = 'http://localhost//phpmyadmin';

+$cfg['PmaAbsoluteUri'] = '';

 

 /**

  * Disable the default warning that is displayed on the DB Details Structure page if

```

----------

## JamesBong

 *Quote:*   

> -$cfg['PmaAbsoluteUri'] = 'http://localhost//phpmyadmin';
> 
> +$cfg['PmaAbsoluteUri'] = ''; 

 

didn't help here, still same Problem. Noone elsse more ideas   :Question: 

Could this be considered a bug then?

----------

## JamesBong

Got it to work   :Very Happy: 

Have a look at row 68 of config.inc.php where it says:

```
$cfg['Servers'][$i]['controlpass']   = '2830110955529917943';
```

I changed the password of the user pma in the mysql-db to a different one and filled the new password in the row.

To change the password I loged in as root

```
mysql -u root -p
```

and entered

```
UPDATE mysql.user SET Password = PASSWORD('newpassword') WHERE User = 'pma';

FLUSH PRIVILEGES;
```

and now it works.Last edited by JamesBong on Mon Feb 20, 2006 11:40 am; edited 1 time in total

----------

## toralf

@JamesBong:

You're sure that you run etc-update and there is no ._cfg* file in the phpmyadmin dir ?

----------

## JamesBong

I am absolutely positiv I ran etc-update. 

 *Quote:*   

> etc-update 
> 
> Scanning Configuration files...
> 
> Exiting: Nothing left to do; exiting. 

 

There are also no *._cfg* files in the phpmyadmin dir.

----------

## frozenJim

I had the same issues.  I am sure that if we knew more about the magic in the config files, this would not be an issue.  But obviously, we do NOT know how to set this all up (yet).

After chasing my tail for a day, I did as Toralf suggested: I ended up using the "Microsoft-troubleshooting-method".

I uninstalled phpmyadmin, removed the php database tables, deleted all phpmyadmin-related config files and htdocs/phpmyadmin.  Then I just emerged phpmyadmin again and ran the magic script.

```
mysql -u root -p < /usr/share/webapps/phpmyadmin/2.7.0_p1/sqlscripts/mysql/2.7.0_p1_create.sql
```

Finally, I copied /var/www/localhost/htdocs/phpmyadmin/config.default.php to config.inc.php and edited the site name (from "localhost").  If you leave it as "localhost" then you won't see your icons - and it won't actually work - but you WILL be able to reach the phpmyadmin page.

It's working.  I'm ashamed of my ignorance - but it's working.

----------

## mrpete

This is a quick and dirty fix but will get you up and running.

Assuming you haven't yet set your mysql root password:-

Edit yout config.inc.php file in your phpmyadmin directory and have the following set:-

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

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

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

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

$cfg['Servers'][$i]['password']      = '';         // MySQL password (only needed with 'config' auth_type)

You should now be able to login  but it will warn you about setting the mysql root password

----------

## derheld42

Saw this:

http://forums.mysql.com/read.php?35,64808,76940#msg-76940

And tried changing localhost to 127.0.0.1 in my config.inc.php file. And what do you freakin know... it worked!

----------

## marky9074

I had exactly the same thing last night.  I changed the control user to root so I could get in.  I saw that the passwords were not the same for the pma user in the mysql database/users and deleted it.  I then unmerged phpmyadmin and then removed the /var/www/localhost/htdocs/phpmyadmin directory so it would be fresh.

Then I emerged again and as if by magic there is a comment at the end saying to 'run this script to finalise the installation'......hmmm, in my haste I had not done this before.  After I done this it was all OK...

Also I noticed that there was not a config.inc.php, so I just copied the config.default.php

Mark

----------

## xsteadfastx

i complete removed the pmadb, deleted the phpmyadmin directory and remerged everything. no success. i cant login as root. what else i can try? really...i need to come on the server again

----------

## holbrook

I had the same problem.  Could not get phpmyadmin to login even though it worked on command line.

I browsed to:

http://localhost//phpmyadmin/scripts/setup.php

And clicked on "edit" under the "server" line.

On the page that came up, I changed "Authentication Type" to "config"

I also set the next two lines to match my mysql user: "User for config auth" and "Password for config auth".

Press "Update".  Then I could log into phpmyadmin.  I am not sure what the security issues are with this, but I'm running on a non-network available computer, so I'm not too concerned.  YMMV.

----------

## bol

I have been sitting all day and tried to get phpmyadmin to work, and this worked like a charm! 

 :Very Happy: 

Thanks!

 *JamesBong wrote:*   

> Got it to work  
> 
> Have a look at row 68 of config.inc.php where it says:
> 
> ```
> ...

 

----------

