Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a piece of code that worked fine all the time, but suddenly it stopped working, very nasty. The relevent part of the code is here:
use LWP::UserAgent; use DBI; use Data::Dumper; use strict; use warnings; my $db = DBI->connect('DBI:mysql:test', 'root', '', {RaiseError => 1}) +; my $ini = $db->prepare('update books set out = 0'); my $ins = $db->prepare('insert into books(name, person, duedate,barcod +e) values(?,?,?, ?)'); my $upd = $db->prepare('update books set duedate = ?, out = 1 where ba +rcode = ?'); my $any = $db->prepare('select count(*) from books where barcode = ?') +;
ANd here is the error:
DBI connect('test','root',...) failed: Can't connect to MySQL server o +n 'localho st' (10061) at a.pl line 8
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suddenly cannot connect to MySQL any more
by fauria (Deacon) on Jul 04, 2005 at 00:12 UTC | |
by Anonymous Monk on Jul 04, 2005 at 00:36 UTC | |
by BUU (Prior) on Jul 04, 2005 at 00:40 UTC |