Page 1 of 1

[Help] CGI Perl with MySQL for Spiderbasic

Posted: Fri Feb 21, 2025 9:48 pm
by mk-soft
I have an old NAS from Buffalo with MySQL and WebServer with Perl.

But I can't get a Perl script to read or write to the MySQL database.
The server does not support the module DBI (use dbi).

After I have output the modules via Perl script, I only find the possibility to solve this with the following modules.
- Session
- Session/Driver
- Session/Driver/MySQL

I am a real beginner with Perl (which does not happen often)

Thanks

Re: [Help] CGI Perl with MySQL for Spiderbasic

Posted: Sat Feb 22, 2025 7:20 pm
by hoerbie
Is there no chance to install the DBI and the DBD-mysql modules? For example using ssh login?
I work(ed) a lot with perl, use(d) the DBI and DBD-mysql, and would love to help you, through pm or mail in german, as you are such a big help for PB.

Re: [Help] CGI Perl with MySQL for Spiderbasic

Posted: Sun Feb 23, 2025 12:43 pm
by mk-soft
I have the module : /usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/DBI.pm
But the perl examples from internet not working.

I think I have to create a valid session first

Perl Script for output all moduls

Code: Select all

use CGI::Carp qw/fatalsToBrowser/;
use strict;
use File::Find qw/find/;

print "Content-type: text/html\n\n";


print "<html><head><title>NAS Module Lister</title></head>";
print "<body><h1>NAS Module Lister.</h1>\n";

print "<p>The values in \@INC:</p>\n";

print "<p><ul>\n";
foreach ( @INC ) {
    print "<li>$_</li>\n";
}
print "</p></ul>\n";

print "<p>The installed modules:</p><ul>\n";
find ( \&wanted, @INC );

print "</ul>";

sub wanted {
    print "<li>$File::Find::name</li>\n";
}

Re: [Help] CGI Perl with MySQL for Spiderbasic

Posted: Sun Feb 23, 2025 1:01 pm
by mk-soft
Part of output

Code: Select all

/usr/lib/perl5/vendor_perl/5.8.8/CGI
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Push.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Fast.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/SpeedyCGI.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Apache.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Pretty.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Cookie.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Switch.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Util.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Carp.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ErrorHandler.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Tutorial.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Test
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Test/Default.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/default.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/storable.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Serialize/freezethaw.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/postgresql.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/mysql.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/file.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/sqlite.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/db_file.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/Driver/DBI.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/incr.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/static.pm
/usr/lib/perl5/vendor_perl/5.8.8/CGI/Session/ID/md5.pm

Re: [Help] CGI Perl with MySQL for Spiderbasic

Posted: Sun Feb 23, 2025 2:52 pm
by hoerbie
Do you have SSH access (as root?) and are the make tools installed?

Then please try:

Code: Select all

wget https://cpan.metacpan.org/authors/id/H/HM/HMBRAND/DBI-1.647.tgz

tar -xzf DBI-1.647.tgz
cd DBI-1.647
perl Makefile.PL
make
make test
make install

wget https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-5.011.tar.gz

tar -xzf DBD-mysql-5.011.tar.gz
cd DBD-mysql-5.011
perl Makefile.PL
make
make test
make install
The Makefile.PL call of the DBD module normally wants a parameter like

Code: Select all

perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config
where the general config file of mysql could be find, maybe you have to search for the file mysql_config and set it, but maybe it will work without.

This is the manually way I use when installing linux servers without package tools.

Re: [Help] CGI Perl with MySQL for Spiderbasic

Posted: Sun Feb 23, 2025 6:32 pm
by mk-soft
DBI is available under Session.
But I can't figure out how to work with Session->Driver->DBI.