When I run this code (assume database, user, pass are defined and correct):
print "Content-Type: text/html\n\n ";
my $dbh = DBI->connect("DBI:mysql:$database", $user, $pass) or print "
+<BR>Couldn't connect to database: " . DBI->errstr;
I get the following error:
Couldn't connect to database: Access denied for user 'myusername'@'localhost' (using password: YES)
From looking around, I find that this is caused by mySQL updating its password encryption and leaving DBI lagging behind. What I want to know is, is there a way to connect to my mySQL server anyway using DBI? Or should I switch to Mysql.pm (no user input is used in the queries, security isn't a major concern - but I'd need a sample of code to use)? Or do I have to figure out how to get a new version of DBI installed on my hosting account?
Usually I'd bypass all the trouble by using PHP (EVIL EVIL FLAME FLAME), but in this case I need a script I can call from shell, so PHP isn't going to cut it. And in case anyone asks, I did try Super Search first - it just turned up a million posts on mySQL, unrelated to my problem.