×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DBI can not connect to mysql!

DBI can not connect to mysql!

DBI can not connect to mysql!

(OP)
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/www/cgi-bin/test.pl line 16
Can't call method "prepare" on an undefined value at /var/www/cgi-bin/test.pl 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).


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close