MySQL Forums
Forum List  »  Perl

Can't connect to mysql from MAMP Perl
Posted by: Richard Nicholas
Date: October 22, 2018 03:59PM


I installed the latest version of MAMP. I am able to connect to mysql with PHP but I want to also connect with Perl. MAMP says use this template:

my $user = 'root';
my $password = 'root';
my $db = 'db';

my $link = DBI->connect(

My database name is actually db. I get this error:

install_driver(mysql) failed: Can't load 'C:/MAMP/bin/perl/vendor/lib/auto/DBD/m
ysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not
be found at C:/MAMP/bin/perl/lib/ line 190.
at (eval 6) line 3.
Compilation failed in require at (eval 6) line 3.
Perhaps a required shared library or dll isn't installed where expected
at line 28.

At someone's suggestion, I added localhost information to the connect like this:

my $link = DBI->connect(

But I get the same error. And the file it says it can't find: C:/MAMP/bin/perl/vendor/lib/auto/DBD/mysql/mysql.dll' is there!

Any help would be appreciated. Its very frustrating to have spent hours just trying to figure out how to *connect*. I can't even get started on real work. Thanks.

Options: ReplyQuote

Written By
Can't connect to mysql from MAMP Perl
October 22, 2018 03:59PM

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.