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