1. make sure that you can connect to the database from the different server
using mysql client.
        Mysql database has a nice feature that allows you to specify which
user with which passwd and from where can access particular schema.

2. if #1 passes make sure that you are specifying right host in connect.

> -----Original Message-----
> From: Simon Chan [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, May 25, 2001 9:43 PM
> To:   [EMAIL PROTECTED]
> Subject:      DBI access from a CGI script
> 
> Hey all,
> 
> Using a CGI script, I want to access a database from A DIFFERENT server
> than the mysql database is
> hosted.  What is the proper syntax to access the mysql database on a
> different server?
> 
> They're 2 levels of secruity:
> 1. Log into Telnet shell
> 2. Log into database
> 
> This is what I have derived from O'Reilly books, though they make the
> assumption that you are
> running the script from the same server as the database:
> 
> $dbh = DBI->connect("dbi:mysql:table1", "$host", "$user", "$password") or
> die "Unable to connect";
> # table1 is the name of database.
> 
> From this code, it doesn't appear to be able to connect to the database,
> perhaps due to the FIRST
> level of secruity.
> 
> Any help would be appreciated.  Many thanks.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/

Reply via email to