TedPride has asked for the wisdom of the Perl Monks concerning the following question:
I get the following error:use DBI; 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;
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI / mySQL: Access denied for user 'myusername'@'localhost' (using password: YES)
by perrin (Chancellor) on Mar 07, 2006 at 05:36 UTC | |
|
Re: DBI / mySQL: Access denied for user 'myusername'@'localhost' (using password: YES)
by hesco (Deacon) on Mar 07, 2006 at 09:37 UTC | |
|
Re: DBI / mySQL: Access denied for user 'myusername'@'localhost' (using password: YES)
by idle (Friar) on Mar 07, 2006 at 07:15 UTC | |
by jhourcle (Prior) on Mar 07, 2006 at 12:39 UTC | |
by Anonymous Monk on Mar 24, 2019 at 06:17 UTC | |
by marto (Cardinal) on Mar 24, 2019 at 06:59 UTC | |
|
Re: DBI / mySQL: Access denied for user 'myusername'@'localhost' (using password: YES)
by TedPride (Priest) on Mar 07, 2006 at 15:08 UTC |