phpmyadmin login problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

phpmyadmin login problem

Post by bugthefixer »

I have installed wamp 1.6.3 on my machine. Initially MySQL user 'root' was set using NO password. But then I assigned it a password. Now the problem is when ever I try to open phpmyadmin it say Access Denied.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Which version of MySQL and which mysql client API are you using? If mysql is over 4.1 and your client is older than 3.23, you are going to have this problem. You made need to edit your my.ini (or my.conf for linux) to add the 'old_passwords'directive to the mysqld section.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Actually I think the solution would be to configure phpMyAdmin to use a password. It attempts to login using root with no password as default. So if a password was set, phpMyAdmin needs to be configured to use the password.
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

Post by bugthefixer »

I am using mysql 5.0 version i cudnt understand which directive you are talking about and wat shud be the value for this directive.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

DB server: MySQL 5.0.
PHP version: ?
MySQL client API version: ?

What type of authentication are you using for PMA, cookie, config or httpd?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

in the installation folder of the phpmyadmin, you should be having config.inc.php, if not available you have to create one.

use this code

Code: Select all

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.8.0.3 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: Sun, 30 Apr 2006 09:22:55 GMT
 */

/* Servers configuration */
$i = 0;

/* Server localhost (config:pma) [1] */
$i++;
$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'] = 'mysqli';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;

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

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

$cfg['Servers'][$i]['user'] = 'pma';
$cfg['Servers'][$i]['password'] = 'pmapass';
$cfg['Servers'][$i]['pmadb'] = 'pmadb';

$cfg['Servers'][$i]['ThemePath'] = '/darkblue_orange';



/* End of servers configuration */

?>

you should also create pma user and password which will be used by phpmyadmin to make changes to their tables. if the pmadb DB is not available, you can find the code for creating it from the documentation they have provided.

you have to make sure, this line has value of http
$cfg['Servers'][$i]['auth_type'] = 'http';
so that we you try access the index.php, it will prompt you for username and password which can be any valid existing username and password in the DB.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

None of this matters if the client api version is to old or the my.ini (my.conf) is not properly set up to handle old passwords with a new api.

On a side note, I have a setup on my devlopment machine that uses config as authentication, user root, no password and it works fine. It also has no PMA table. My production server has PMA set http authentication. No PMA table, but all DB users have a password.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Everah wrote:None of this matters if the client api version is to old or the my.ini (my.conf) is not properly set up to handle old passwords with a new api.

I remember that when you put the phpmyadmin folders inside documentRoot, it will first try to connect to DB using root with no password. But if you want to connect with password, you have to create the config.inc.php where it reads how to configure the phpmyadmin to work. The authentication type would not be http for the first time you run phpmyadmin, and it will be using root with no password. You can alternatively retain the older authentication type but still you have to put a valid username and password if you do not want yourself or the users authenticated through HTTP. If you choose HTTP, you do not have to mention the username and password and the DB since these would anyway be asked when you try accessing index.php in phpmyadmin installation/root folder.
On a side note, I have a setup on my devlopment machine that uses config as authentication, user root, no password and it works fine. It also has no PMA table. My production server has PMA set http authentication. No PMA table, but all DB users have a password.
you are right. The phpmyadmin can work without the DB for itself. But if the DB is available it will save some information on our user sessions and about the data available in our mysql DBs.
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

Post by bugthefixer »

Thanks raghavan and every one else .... actually the password was not set in phpmyadmin config file i.e. config.inc.php so now it works fine .... thanx again
Post Reply