Solved

Perl MySQL connection problem

Posted on 2014-12-28
1
227 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
1 Comment
 
LVL 82

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now