From: Qinying Xu
> 
> I am coding an web appliction, which should connect to
> Mysql DB. I tried the connection source cold on Linux,
> it works well. But when I run it through the web, the
> scripts just stopped.  I found it died after runing the
> line:
> my $conn = Mysql->connect($self->{db_host},
> $self->{db_name},$self->{db_user},$self->{db_pw});
> 
> I checked this line successfully ran on linux machine.
> 
> Please help!
> 

When running as a web application, the script runs in the context of
that server and the user that server runs under, which are significantly
different from your user context.

1. Does the web server user have access rights to open a connection on
the MySQL server?

2. Do they have rights to access the database?

3. Do the server error logs contain any messages about this problem?

4. Did you try adding the standard exception handler to the connect() or
code to test it to make sure it worked when running on the web server?

For example, I run Apache as user www and group httpd. So I have to
grant user www any rights it needs for each PostgreSQL database I want
to access from the web server.

Bob McConnell

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to