MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:April 4 2004 6:12pm
Subject:Re: Unable to connect to mysql with phpmyadmin
View as plain text  
Marvin Cummings wrote:

> I've tried it both ways using the default root and no password and root with
> my assigned password. Either way returns an error. Here's a part of my
> config.inc.php file:
> 
> // The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use
> $cfg['Servers'][0].
> // You can disable a server config entry by setting host to ''.
> $i++;
> $cfg['Servers'][$i]['host']          = 'localhost'; // MySQL hostname or IP
> address
<SNIP>
> $cfg['Servers'][$i]['auth_type']     = 'HTTP';    // 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)
<SNIP>
> Again I've tried it with 'config' and 'HTTP' as the 'auth_type' with and
> without a password. I'm sure I'm missing something. 
> 
>  Thanks again

I know you must be frustrated, but root@localhost either has a password or 
it doesn't -- there's no sense trying the other.  From your description, I 
take it that root does have a password.

First, verify that the password works.  Try

   mysql -u root -p

at the command line, and enter the password when prompted.  If that works, 
then you know that you have the correct user-password combination for mysql. 
  Be sure to tell us that this worked (or didn't) in your next post. 
Assuming it worked, you'll see something like, "Your MySQL connection id is 
13 to server version: 4.0.17" on the second line.  Make note of the server 
version number and tell us what it is.

The next step is to see if we can get PHP/phpmyadmin to talk to mysql.  The 
simplest (Note, I did not say best.) way is to use config.  So, in your 
config.inc.php, set auth_type to config, and password to your mysql root 
password.  This should work, but from what you've said, it won't.  In your 
next post, tell us what error message you get in this case, particularly 
whether it says "YES" or "NO".

Finally, tell us some more about your setup.  I imagine you have the latest 
phpmyadmin, as you just set it up.  What about PHP?  We need to know 2 
things: which version of PHP you have, and which version of MySQL it was 
built against.  If I recall correctly, PHP's built-in MySQL support is 
version 3.23.49, which is rather old.  MySQL's authentication mechanism has 
been changed in 4.1 and later.  If you don't know the answers to those 2 
questions, make a file in your webspace (same directory as config.inc.php 
would do) with

   <?php phpinfo() ?>

as the contents.  Pull that up in your web brpwser to see a ton of info. 
The version of PHP will be right at the top, and MySQL support info will be 
down in the mysql section.  Tell us what it says for "Client API version".

I know I'm asking you to do a couple of things you've already done, but it's 
difficult to troubleshoot when we can't be sure exactly which error message 
went with which attempt.  My hope is that with specific info, we'll be able 
to narrow down where the problem lies.

Michael

P.S.  Note that using auth_type=config in your config.inc.php along with 
your mysql root password means that anyone who can access phpmyadmin will 
have root access to mysql.  So, once you get this working, you will need to 
either protect access to phpmyadmin or switch to another auth_type.

Thread
Unable to connect to mysql with phpmyadminMarvin Cummings4 Apr
  • Re: Unable to connect to mysql with phpmyadminMichael Stassen4 Apr
RE: Unable to connect to mysql with phpmyadminMarvin Cummings4 Apr
RE: Unable to connect to mysql with phpmyadminMarvin Cummings4 Apr
RE: Unable to connect to mysql with phpmyadminMarvin Cummings4 Apr
  • Re: Unable to connect to mysql with phpmyadminMichael Stassen4 Apr
    • RE: Unable to connect to mysql with phpmyadminMarvin Cummings5 Apr
      • Re: Unable to connect to mysql with phpmyadminMichael Stassen5 Apr