Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBI can not connect to mysql!

Status
Not open for further replies.

photores

Programmer
Sep 12, 2000
13
0
0
RU
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 qw:)standard);
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).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top