Solved

Perl MySQL connection problem

Posted on 2014-12-28
1
235 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 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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