List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:October 27 2005 5:49pm
Subject:Re: Mysql privs via PHP? Problems
View as plain text  
T.J. Mahaffey wrote:
> It seems my MySQL privs aren't working properly.
> Symptom is that PHP scripts themselves won't authenticate to MySQL  
> *unless* the script uses the root MySQL login/pw.
> 
> I've verified that my added MySQL logins are set up and working in  the 
> command line and they show up properly in phpmyadmin, but don't  seem to 
> work as far as PHP is concerned.
> 
> Entropy PHP 4.3.11
> MacOS X Server 10.4
> 10.4's default MySQL install
> 
> Can someone assist? I'd appreciate it very much. (Been fighting this  
> one all day yesterday...)
> 
> -- 
> T.J. Mahaffey
> tj@stripped

The key to fixing these sorts of problems is to write php code that tells you 
what the error is, rather than simply failing.  Please pick one of your scripts 
(or make a test one) and make the connect code look like this:

   $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
     or die('Could not connect: ' . mysql_error());

(replace mysql_host, mysql_user, and mysql_password with the appropriate 
values).  The second line is the key.  When this fails to connect, the error 
message from mysql will be printed.  Reply with the connect code (but don't show 
us the real password, of course) and the exact error message (copy/paste). 
Armed with that information, I'm sure we can tell you what's wrong.

Michael

Thread
'Autoextend' datafile - Mysql-Max-4.1.14 - LinuxTom Brown25 Oct
  • Re: 'Autoextend' datafile - Mysql-Max-4.1.14 - LinuxJigal van Hemert26 Oct
    • Re: 'Autoextend' datafile - Mysql-Max-4.1.14 - LinuxTom Brown26 Oct
      • Re: 'Autoextend' datafile - Mysql-Max-4.1.14 - LinuxJigal van Hemert27 Oct
      • Mysql privs via PHP? ProblemsT.J. Mahaffey27 Oct
        • Re: Mysql privs via PHP? ProblemsMichael Stassen27 Oct
          • Re: Mysql privs via PHP? Problems - * Now with error messageT.J. Mahaffey27 Oct
            • Re: Mysql privs via PHP? Problems - * Now with error messageHassan Schroeder27 Oct
            • Re: Mysql privs via PHP? Problems - * Now with error messageJasper Bryant-Greene27 Oct