CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Connecting Mysql 5 problem (worked great on 3)

 



jimbocpi
New User

Apr 2, 2013, 10:55 AM

Post #1 of 6 (761 views)
Connecting Mysql 5 problem (worked great on 3) Can't Post

Hi we just migrated a database from mysql 3.5 to mysql 5.5.
Any perl scripts that run on the server (centos) work fine.
We have a desktop application written in perl which won't connect to the new database.


Code
my $db = DBI->connect("DBI:mysql:host=10.0.0.123;database=db","username","password");


returns a error "Client doesn't support authentication method requested by server"

The desktop perl application runs on Windows machines.
We are using perl version 5.8.3

DBMs installed are ExampleP, File, Proxy, Sponge, XBase, and mysql.
DBD:: says no odbc drivers installed.

I installed the most current windows driver for mysql.
I can't uninstall the windows 3.51 driver.

Anyone have suggestions on the most unobtrusive method of fixing this problem? I've searched all over the internet.

Thanks.


FishMonger
Veteran / Moderator

Apr 2, 2013, 11:29 AM

Post #2 of 6 (759 views)
Re: [jimbocpi] Connecting Mysql 5 problem (worked great on 3) [In reply to] Can't Post

Are you sure the error message is coming form that line?

That doesn't look like a perl generated error message. It looks more like a custom error messages written by the author of the script.

Do you have the DBI and DBD::mysql modules installed? If so, what versions. If not, you'll need to install those modules.

You might need to post the entire script.


jimbocpi
New User

Apr 2, 2013, 12:00 PM

Post #3 of 6 (755 views)
Re: [FishMonger] Connecting Mysql 5 problem (worked great on 3) [In reply to] Can't Post

Hi,

Yes it takes a few lines a code to produce the error.


Code
use strict; 
use DBI;
my $db = DBI->connect("DBI:mysql:host=10.0.0.123;database=dbname","username","password");


I didn't print out the whole message error line. Remember this is running from the Windows dos prompt.

"Client does not support authentication protocol requested by server; consider upgrading mySQL client at Line 6"

Again, this has worked since 2003 in mysql version 3.x.
I just can't get a windows desktop machine to recognize the new driver I just installed.

DBI is version 1.42

I am nervous about upgrading the DBI/DBD because this is a very large system and it could have cascading effects.


FishMonger
Veteran / Moderator

Apr 2, 2013, 12:12 PM

Post #4 of 6 (752 views)
Re: [jimbocpi] Connecting Mysql 5 problem (worked great on 3) [In reply to] Can't Post

What is line 6 of your script?

I suspect it's

Code
use Mysql;

which is an old depreciated module.

Install DBD::mysql and replace that line with

Code
use DBD::mysql;


Also, change you connect statement to this

Code
my $dbh = DBI->connect("DBI:mysql:10.0.0.123:dbname","username","password", 
{ RaiseError => 1 }
or die "Database connection failed" . $DBI::errstr);



FishMonger
Veteran / Moderator

Apr 2, 2013, 12:17 PM

Post #5 of 6 (751 views)
Re: [jimbocpi] Connecting Mysql 5 problem (worked great on 3) [In reply to] Can't Post


Quote
I installed the most current windows driver for mysql.
I can't uninstall the windows 3.51 driver.


I'm not sure what driver you're referring to, but on the perl side you only need 2 modules (DBI and DBD::mysql). You do not need any other external drivers.


jimbocpi
New User

Apr 2, 2013, 12:20 PM

Post #6 of 6 (750 views)
Re: [FishMonger] Connecting Mysql 5 problem (worked great on 3) [In reply to] Can't Post

Fixed my own problem. I got it off a drupal message board (go figure).

Mysql went from a 16 bit hash password to 41 bit hash password.

I had to go into the mysql->user table and for the user connected to the database change the password from 41 to 16 bit.

This is done using the OLD_PASSWORD command in mysql.

Thanks for your help.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives