Hi Monks,
I wonder if anyone can help me?. I've got a problem getting connections to a MySQL database. Basically I developed the code on my machine at home before uploading it to the web hosting company. Everything worked fine at home but at the host company my connections to MySQL stopped working with the
Client does not support authentication protocol requested by server; consider upgrading MySQL client error. A quick search of the internet later and everyone said it was problem to do with MySQL hashing algorithm changing (http://dev.mysql.com/doc/refman/4.1/en/old-client.html). The main suggestion (other than upgrading the client) is to use the old_password function. My ISP does not give me permission to run this so I can't use this work around. Before I pinged an email to the ISP I thought I'd just check the DBI and DBD versions on both sides. Bizarrely the ones at the ISP were more up-to-date than mine?
To recap,
This works..
DBI Version 1.38
DBD Version 2.9007
This doesn't ..
DBI Version 1.50
DBD Version 3.0002
I'm connecting my home code directly to the MySQL database at the ISP so all tests are running against the same MySQL database (Version 4.1.14).
Example code..
#!/usr/bin/perl
use DBI;
use DBD::mysql;
print q(Content-Type: text/html; charset=ISO-8859-1
);
print "DBI Version=" . $DBI::VERSION;
print "<BR>DBD Version=" . $DBD::mysql::VERSION;
$dbh = DBI->connect("DBI:mysql:<DATABASE NAME>:localhost","<USERNAME>"
+,"<PASSWORD>")
or print "<BR>Couldn't connect to database: " . DBI->errstr;
$query=q{select user()};
$sth = $dbh->prepare($query);
$sth->execute();
my $user_info;
$sth->bind_columns(\$user_info);
$sth->fetch();
print "<BR> User connected to MySql: $user_info";
Does anyone have any ideas?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.