Hi, guys!
Please, help.
I write script that use DBI for connecting to Mysql, but I have error:
*
(98)Address already in use: make_sock: could not bind to port 80
DBI->connect(mail_list:localhost:3306) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at /var/ line 16
Can't call method "prepare" on an undefined value at /var/ line 18.
*
I try change users access e.t.c., but without results.
Please HELP!
###########################################
#!/usr/bin/perl
################################
use CGI qwstandard);
use DBI;
use Parse;
my $tpl = new Parse;
use strict;
my $db = param('db');
my $query = param('query');
print "Content-type: text/html\n\n";
if($query) {
my $dbh = DBI->connect("DBI:mysql:$db:localhost:3306"
my $dbs = $dbh->prepare($query);
$dbs->execute;
my $err = $dbh->errstr;
if($err) {
$tpl->{'ERROR'} = "À âîò è îøèáî÷êà ñëó÷èëàñü: $err";
$tpl->{'DB'} = $db;
}
}
Edited by photores on 03/26/01 08:16 AM (server time).
Please, help.
I write script that use DBI for connecting to Mysql, but I have error:
*
(98)Address already in use: make_sock: could not bind to port 80
DBI->connect(mail_list:localhost:3306) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) at /var/ line 16
Can't call method "prepare" on an undefined value at /var/ line 18.
*
I try change users access e.t.c., but without results.
Please HELP!
###########################################
#!/usr/bin/perl
################################
use CGI qwstandard);
use DBI;
use Parse;
my $tpl = new Parse;
use strict;
my $db = param('db');
my $query = param('query');
print "Content-type: text/html\n\n";
if($query) {
my $dbh = DBI->connect("DBI:mysql:$db:localhost:3306"
my $dbs = $dbh->prepare($query);
$dbs->execute;
my $err = $dbh->errstr;
if($err) {
$tpl->{'ERROR'} = "À âîò è îøèáî÷êà ñëó÷èëàñü: $err";
$tpl->{'DB'} = $db;
}
}
Edited by photores on 03/26/01 08:16 AM (server time).