Jan 22, 2003, 1:04 PM
Post #1 of 2
I am trying to get a CGI Script working from a client machine on my LAN but have been unsuccessful.
Access a database using Perl across a LAN
My configuration consists of 2 PC's. A Linux Server (hostname: infoserve.linpc, IP: 10.0.0.1) and a win98
client (hostname: infoserve.winpc, IP:10.0.0.2) Both are networked correctly together and I currently have
no network issues. I can browse a web page from "winpc" no problem and execute cgi-scripts successfully also.
I have setup a simple test database on the server called "cars", with one table called "adverts" and have given
user access to a user called "fred" with the password "fred". On my client machine (winpc) I have a program
called "MySQL Front" which allows me to administer a database remotly. I can connect to the database "cars"
without problem and can modify it also, thus verifying remote ability to access the database.
My problem is that I am new to perl and am having problems getting my script to operate correctly. I simple want
to "SELECT * FROM adverts". I can successfully run other scripts from the cgi-bin where I locate the MySQL perl code.
I am pretty sure that I have the correct modules installed on my server but need to verify this.
The modules installed are as follows:
# rpm -qa | grep mysql
# rpm -qa | grep perl
My questions are:
1. Do I have the right "tools" / modules to undertake this task?
2. Is it possible to test my configuration and access the database before I leap into the Perl Code?
3. Could anyone suggest a link / tutorial with a snippet of code which allows me to access a database
and simply grab a row of data. Perferably the absoulte minimum code possible to achieve this would
It's possible my existing code is complete crap, and I just need to get up to speed with perl!