
Troy
Novice
Jan 22, 2003, 1:04 PM
Post #1 of 2
(532 views)
|
|
Access a database using Perl across a LAN
|
Can't Post
|
|
I am trying to get a CGI Script working from a client machine on my LAN but have been unsuccessful. 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 ---------------------------- mysql-3.23.41-1 mysqlclient9-3.23.22-6 mysql-server-3.23.41-1 mysql-devel-3.23.41-1 # rpm -qa | grep perl ---------------------------- perl-5.6.0-17 perl-DBI-1.18-1 perl-DBD-MySQL-1.2216-4 mod_perl-1.24_01-3 perl-Data-Dumper-2.09-1 perl-DBD-Pg-1.01-1 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 be fantastic!!! It's possible my existing code is complete crap, and I just need to get up to speed with perl! Thanks, - Troy
|