MySQL Forums
Forum List  »  Install & Repo

MySQL Upgrade to 5.1.57 Bad Handshake when connecting from Perl/CGI
Posted by: l roles
Date: May 13, 2011 01:23PM

Dear all,

I have just upgraded from MySQL 4.1 > MySQL 5.1 on RHEL 4. I downloaded 5 packages from the MySQL downloads section:


I first uninstalled the old rpms using rpm -e --nodeps <package>.rpm
Then installed the new ones using rpm -i <package>

I now have the Database upgraded, but I have this problem with Perl scripts using DBI::mysql to interface with MySQL.

Here is the error message (This doesn't give much direction as to what's wrong):

Bad handshake at line 63

Here is the line of code which is causing the problem.

my $dbh = DBI->connect('DBI:mysql:test:'.get_db(), 'root', '')
or die $DBI::errstr;


I can create a simple new script inside Apache which uses the above connection parameters and I can connect and query data. However, the exact same connection parameters from inside my existing website script does not connect, failing with a 'Bad Handshake' error.

This makes no sense... Has anyone seen this error message before?

MySQL error log doesn't show anything either:

110513 15:12:06 mysqld_safe mysqld from pid file /var/lib/mysql ended
110513 15:12:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110513 15:12:07 [Note] Plugin 'FEDERATED' is disabled.
110513 15:12:07 InnoDB: Initializing buffer pool, size = 8.0M
110513 15:12:07 InnoDB: Completed initialization of buffer pool
110513 15:12:07 InnoDB: Started; log sequence number 0 44233
110513 15:12:07 [Note] Event Scheduler: Loaded 0 events
110513 15:12:07 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.57-community' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

a) Can anyone give me any explanation as to what the error message means?
b) Will I need to recompile DBI::mysql? I thought mysql-shared-compat would take care of any driver issues.
c) Any other pointers?

Edited 2 time(s). Last edit at 05/15/2011 04:06AM by l roles.

Options: ReplyQuote

Written By
MySQL Upgrade to 5.1.57 Bad Handshake when connecting from Perl/CGI
May 13, 2011 01:23PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.