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