Page 1 of 1

[SOLVED] Ask for Username and Password in phpMyAdmin

Posted: Sun Mar 27, 2005 6:54 am
by anjanesh
I have phpMyAdmin setup alright but the url is like http://www.xxx.com/phpMyAdmin
This automatically connects to the database with username and password - thats because its set in config.inc.php.
Any way to have it ask for username and password ?
Thanks

Posted: Sun Mar 27, 2005 10:15 am
by Chris Corbyn
Not that I'm aware of... it's open source though so probably not too difficult to implement :)

Posted: Sun Mar 27, 2005 10:20 am
by neophyte
Just create .htaccess and a .htpassword file. That will protect the entire directory. Read more here.

http://www.2020dns-hosting.net/help/access.html

Posted: Sun Mar 27, 2005 10:48 am
by Sphen001
Well, I know there is a way to force phpMyAdmin to ask for passwords. I think it has something to do with the config file. There should be some info in the manual.

Also, I wouldn't recommend .htaccess because it could get really difficult to maintain. Better stick with the built in authentication.

Sphen

Posted: Sun Mar 27, 2005 11:00 am
by neophyte
I'm really curious now because I've never heard of phpmyadmin having any sort of a user system. Do they? Anyone know for sure. Because I've only seen it with an external user system or .htaccess. That'd be great if they do...

Posted: Sun Mar 27, 2005 11:00 am
by anjanesh
I could not find anything in config.inc.php regarding this.
There is a $cfg['Servers'][$i]['password'] = "mypassword" where if I have it null $cfg['Servers'][$i]['password'] = "", it'll say access denied because not using password etc.
The only other thing I found in config.inc.php was this :

Code: Select all

/**
 * If you wish to use the SQL Validator service, you should be
 * aware of the following:
 * All SQL statements are stored anonymously for statistical purposes.
 * Mimer SQL Validator, Copyright 2002 Upright Database Technology.
 * All rights reserved.
 */
$cfgї'SQLValidator']ї'use']      = FALSE;   // Make the SQL Validator available
$cfgї'SQLValidator']ї'username'] = '';      // If you have a custom username, specify it here (defaults to anonymous)
$cfgї'SQLValidator']ї'password'] = '';      // Password for username
Before I change anything, what is this SQL Validator service ?
Thanks

Posted: Sun Mar 27, 2005 11:04 am
by Sphen001
Hmm...

Well, I've seen phpMyAdmin screens where I have had to enter my username and password before I could access it. Maybe I'm mistaken. I'll go take a look over at the site and see what I can dig up. :D

Sphen

Posted: Sun Mar 27, 2005 11:07 am
by John Cartwright
You do require a password is the default username does not contain a password.
It requires some sort of validation or anyone would have access to your machines db 8)

I believe, not too sure though.

Posted: Sun Mar 27, 2005 11:07 am
by Sphen001
Okay, well I found this docs page.

Maybe it was the cookie auth method I was thinking about...

Sphen

Posted: Sun Mar 27, 2005 11:07 am
by feyd

Code: Select all

$cfgї'Servers']ї$i]ї'auth_type']     = 'http';                         // Authentication method (config, http or cookie based)?
$cfgї'Servers']ї$i]ї'user']          = 'your mysql username';          // MySQL user
$cfgї'Servers']ї$i]ї'password']      = 'your mysql password';          // MySQL password (only needed

Posted: Sun Mar 27, 2005 11:08 am
by neophyte
Unless you're going to have a lot of people accessing phpmyadmin. I don't think anything more than .htaccess is necessary.htaccess will allow you to set up multiple users too.

Posted: Sun Mar 27, 2005 11:10 am
by neophyte
The mighty feyd is here on easter to rescue us from our ignorance. :wink:

Posted: Sun Mar 27, 2005 11:14 am
by anjanesh
Feyd : Thank you very much.
neophyte wrote:The mighty feyd is here on easter to rescue us from our ignorance
He already has answerd it - and I wonder how he manages to get all answers so quickly.

Posted: Sun Mar 27, 2005 11:23 am
by feyd
I wonder how he manages to get all answers so quickly.
Most times, I've gone through or know enough about a subject to figure it out real fast. Part of the reason I charge what I do for work ;) I seem to have a really good memory about code for some reason. I have horrid memory pretty much everywhere else though :lol:

This particular instance, I've gone through and figured out how phpMyAdmin is configured for it previously. Reading the docs helps :P