Solved

Perl MySQL connection problem

Posted on 2014-12-28
1
237 Views
Last Modified: 2014-12-29
I am trying to get a connection to mysql on localhost but having issues.
First, looks like the only DBD mysql package available for my win64 maching is DBD-mysqlPP (when searching with ppm).
I have installed the DBD-mysqlPP package successfully but when attempting a connection I get an error "#08S01Bad handshake". Any assistance would be much appreciated!  Perl newbie (duh).
Here is my perl page:

#!C:\wamp\bin\perl\bin\perl
use strict;
use warnings;
use CGI qw{ :standard };
use CGI::Carp qw{ fatalsToBrowser };
use DBI;
use DBD::mysqlPP;

# Connect to the database.
my $dbh = DBI->connect("DBI:mysqlPP:database=main_db;host=localhost","","",{'RaiseError' => 1});

# HTTP HEADER
print "Content-type: text/html; charset=iso-8859-1\n\n";

print "hello";
0
Comment
Question by:kevbob650
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40521392
Your code does not match the example on the man page: http://search.cpan.org/dist/DBD-mysqlPP/mysqlPP.pm  In addition, I have never seen any connection to MySQL that would work without a username.  Look in the config for phpMyAdmin to find out what it's using.
0

Featured Post

Webinar: Security & Encryption in the MySQL world

Join Percona’s Solutions Engineer, Dimitri Vanoverbeke as he presents “Security and Encryption in the MySQL world” on Thursday, July 6, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Creating and Managing Databases with phpMyAdmin in cPanel.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question