phpMyAdmin 2.8.0.2 install problem - #1045 (Access denied)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

phpMyAdmin 2.8.0.2 install problem - #1045 (Access denied)

Post by Donny Bahama »

This is probably something simple/stupid, but I'm trying to set up phpMyAdmin (php 4.1/mysql 4.4.2 on Windows 2K Server with IIS 5) and I'm having a problem...

auth_type in config.inc.php is set to http (config just fails) and when I try to access phpMyAdmin/index.php it pops up a login dialog. But no matter what I put in that dialog, it pops up two more times then I get a 401.5 (Unauthorized) page.

Any suggestions would be greatly appreciated.

EDIT: Note that due to my php and mysql versions, I had to use the OLD_PASSWORD function in mysql, but I don't think that's an issue here, since I'm not even getting past the authentication.
Last edited by Donny Bahama on Thu Mar 23, 2006 12:19 pm, edited 1 time in total.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Can you use cookie type authentication then login as one of the mysql users in the mysql.user table?
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

Post by Donny Bahama »

Thanks very much for the response! I didn't think of trying that. I'll do it now and report back.
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

A bit of progress, maybe...

Post by Donny Bahama »

Note: I removed your username and passwords for your sake - pickle

OK, I changed the auth_type to cookie and set the controluser and controlpass parameters in config.inc.php. Then, on the server, I ran the sql query (the query ran fine - no errors) as shown in PMA's documentation.html file:

Code: Select all

GRANT USAGE ON mysql.* TO 'XXX'@'localhost' IDENTIFIED BY 'XXXXX';
GRANT SELECT (
    Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
    Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
    File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
    Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
    Execute_priv, Repl_slave_priv, Repl_client_priv
    ) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'xxx'@'localhost';
GRANT SELECT ON mysql.host TO 'xxx'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
    ON mysql.tables_priv TO 'xxx'@'localhost';
Now I'm getting a different error:
The configuration file now needs a secret passphrase (blowfish_secret).
But I have the blowfish passphrase set, so I don't understand why it would say that. I'll post my entire config.inc.php in case it helps...

Code: Select all

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.8.0.2 setup script by Michal ÄŒihaÅ™ <michal@cihar.com>
 * Version: $Id: setup.php,v 1.23.2.2.2.1 2006/03/08 19:06:48 nijel Exp $
 * Date: Mon, 20 Mar 2006 23:15:41 GMT
 */

/* Servers configuration */
$i = 0;

/* Server sdqa (config:donnyb) [1] */
$i++;
$cfg['Servers'][$i]['PmaAbsoluteUri'] = 'http://sdqa/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]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['controluser'] = 'XXX';
$cfg['Servers'][$i]['controlpass'] = 'XXXXXX';
$cfg['Servers'][$i]['blowfish_secret'] = 'XXXXXX';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'mydomain\user_me';
$cfg['Servers'][$i]['password'] = 'XXXXX';
$cfg['Servers'][$i]['verbose'] = 'sdqa';
$cfg['Servers'][$i]['pmadb'] = 'sdqaforum';

/* End of servers configuration */

$cfg['ForceSSL'] = false;
$cfg['ShowPhpInfo'] = true;
$cfg['ShowChgPassword'] = true;
$cfg['AllowArbitraryServer'] = true;
$cfg['LoginCookieRecall'] = 'something';
$cfg['LoginCookieValidity'] = 1800;
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

viewtopic.php?t=45880 may be of interest.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

EDIT: Sorry, missed that one. What version of PMA are you running? That config file looks awfully old.
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

Post by Donny Bahama »

Thanks, feyd but the user in that post had left his blowfish passphrase blank. (I did, too, originally.) When he entered a string (as I have now), it worked for him. Mine does not. :(

Everah: I'm running PMA v. 2.8.0.2. Apparently it was only very recently released... perhaps I need to use an older version?

Thanks a bunch for the help, guys! :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

This may sound off the wall, but did you get this app from the PMA web site or is this someone else's build? The config file looks totally different than what I am used to seeing. Typically the blowfish phrase is a "globally" defined config var. The way yours is set up looks like the phrase is within the server config assignments.

Have you tried using a 'Config' type set up where you supply the mysql username and password? Or is this meant to be used by other database users?
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

Post by Donny Bahama »

I got it off of the PMA website. The blowfish passphrase was an empty string by default. What I posted earlier was a string that I had typed in.

I think I'm getting closer to resolving this... Last night I set it up on my server at home. Initially, I got the exact same error. Then I edited config.inc.php as follows and everything worked.

Code: Select all

<?php
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'pa55word';
?>
So I tried this at work this morning but I'm getting
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
But there's one significant difference... at home I downloaded and set up 2.7.0-pl2 (instead of 2.8.0.2). I'm going to try that at work and see if the problem gets resolved.

Thanks again for the help! :)
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

Looks like there's a problem

Post by Donny Bahama »

Looks like there's a problem in 2.8.0.2 - I installed 2.7.0-pl2 and it's now working.

I really appreciate the help on this - I don't think I'd have figured it out on my own.

Cheers!
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

DOH!

Post by Donny Bahama »

I went to the PMA website to report this problem and in doing so I stumbled across their forum. (I thought they didn't have one but it's here.) Anyway, I found several topics complaining of this same exact issue with 2.8.0.2. One of the topics said:
Sounds like you're missing the
$i=0;
$i++;
at the top of your config.inc.php, after the <%php and before any configuration directives.
A response to that confirmed that it fixed the problem. I could reinstall 2.8.0.2 and check it, but I've wasted enough time on this (and 2.7 will be fine for me.) Just thought I'd post this here in case it helps someone later. :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

That error you are getting implies a MySQL password style conflict with the installed MySQL client library. As of MySQL 4.1 the password hashing algorithm used by the MySQL password() function increased the size of the password field. Using an old MySQL password will give different results in the newer version of MySQL. This error is independant of phpMyAdmin and has everything to with the MySQL client that is installed on the machine. If you are using a version of PHP older than 4.4 then you are probably still using the MySQL 3.23 library which will often cause this problem.
Donny Bahama
Forum Newbie
Posts: 18
Joined: Wed Mar 22, 2006 2:48 pm

I don't think so...

Post by Donny Bahama »

I don't think it was a password issue. I've run across that problem a number of times and I know the workaround...

Code: Select all

mysql> set password for
    -> 'root'@'localhost' = OLD_PASSWORD('pa55word');
I did that, but the problem persisted. I'm betting that

Code: Select all

$i=0; 
$i++;
is the solution.

Besides, if it was a password issue, it should have been equally a problem in 2.7.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Can you access MySQL from the command prompt? How about from other PHP apps on the server? That is a sure fire way to tell if it is PMA or the DB.
Post Reply