Problem Connecting to MySQL Database

This is a multi-part message in MIME format.

--===============0785148211==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0000_01CB5DBE.BD640810"

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01CB5DBE.BD640810
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState Perl
- I'm using version 5.8.8 at the moment. I did this to make it easier to
install some of the modules I wanted but I'm not sure I wouldn't have been
better just to use the Perl that comes with the Mac OS!



The problem I have is that I can't connect to a MySQL database that I have
on the MacBook, set up using MAMP PRO. When I was running everything under
Windows I used to have the DBD::mysql driver installed but this doesn't seem
to be available for this build so I'm using DBD::mysqlPP which I assume
should work in the same way. However the connection string fails when I try
to connect using the following:



$dsn = "DBI:mysqlPP:host=localhost:database=$database";

$dbh = DBI->connect($dsn, $username, $database, {

RaiseError => 0,

PrintError => 0

}) || ($error = "Got error '$DBI::errstr' when connecting to $dsn\n");



and the error message is:



Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
connect: Connection refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
connecting to
DBI:mysqlPP:host=localhost:database=$database.



I've checked that I was using the correct username and password, setting up
and trying different ones, but without success. I have a feeling that I read
somewhere that there was a problem using Perl to connect to a database set
up under MAMP but can't recall what the problem was.



Can anyone suggest why this is not working.



Eric Robertson




------=_NextPart_000_0000_01CB5DBE.BD640810
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Courier New";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"2050" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>I’m using a MacBook Pro running OS X =
10.6.4 and
I installed ActiveState Perl - I’m using version 5.8.8 at the =
moment. I
did this to make it easier to install some of the modules I wanted but
I’m not sure I wouldn’t have been better just to use the =
Perl that
comes with the Mac OS!<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>The problem I have is that I can’t =
connect to a
MySQL database that I have on the MacBook, set up using MAMP PRO. When I =
was
running everything under Windows I used to have the DBD::mysql driver =
installed
but this doesn’t seem to be available for this build so I’m =
using
DBD::mysqlPP which I assume should work in the same way. However the =
connection
string fails when I try to connect using the =
following:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";<o:p></o:p>=
</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>$dbh =3D
DBI->connect($dsn, $username, $database, =
{<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>   =
RaiseError
=3D> 0,<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>   =
PrintError
=3D> 0<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>}) || ($error =
=3D "Got
error '$DBI::errstr' when connecting to =
$dsn\n");<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>and the error message =
is:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>Got error =
'Couldn't
connect to localhost:3306/tcp: IO::Socket::INET: connect: Connection =
refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when =
connecting
to<br>
DBI:mysqlPP:host=3Dlocalhost:database=3D$database.<o:p></o:p></span></fon=
t></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>I’ve checked that I was using the =
correct
username and password, setting up and trying different ones, but without
success. I have a feeling that I read somewhere that there was a problem =
using
Perl to connect to a database set up under MAMP but can’t recall =
what the
problem was.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>Can anyone suggest why this is not =
working.<o:p></o:p></span></font></p>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Eric Robertson<o:p></o:p></span></font></p>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Courier New"><span =
lang=3DEN-GB
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0000_01CB5DBE.BD640810--


--===============0785148211==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0785148211==--
Eric Robertson [ So, 26 September 2010 22:06 ] [ ID #2048116 ]

RE: Problem Connecting to MySQL Database

This is a multi-part message in MIME format.

--===============0216709024==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0037_01CB5E7A.D45C4930"

This is a multi-part message in MIME format.

------=_NextPart_000_0037_01CB5E7A.D45C4930
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

On Mon, Sep 27, 2010 at 3:06 AM, Eric Robertson <ericrob [at] blueyonder.co.uk>
wrote:

I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState Perl
- I'm using version 5.8.8 at the moment. I did this to make it easier to
install some of the modules I wanted but I'm not sure I wouldn't have been
better just to use the Perl that comes with the Mac OS!

The problem I have is that I can't connect to a MySQL database that I have
on the MacBook, set up using MAMP PRO. When I was running everything under
Windows I used to have the DBD::mysql driver installed but this doesn't seem
to be available for this build so I'm using DBD::mysqlPP which I assume
should work in the same way. However the connection string fails when I try
to connect using the following:

$dsn = "DBI:mysqlPP:host=localhost:database=$database";
$dbh = DBI->connect($dsn, $username, $database, {
RaiseError => 0,
PrintError => 0}) || ($error = "Got error '$DBI::errstr' when
connecting to $dsn\n");

and the error message is:

Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
connect: Connection refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
connecting to
DBI:mysqlPP:host=localhost:database=$database.

I've checked that I was using the correct username and password, setting up
and trying different ones, but without success. I have a feeling that I read
somewhere that there was a problem using Perl to connect to a database set
up under MAMP but can't recall what the problem was.

Can anyone suggest why this is not working.

Eric Robertson

_____

From: Tim Bolshaw [mailto:timothybolshaw [at] gmail.com]
Sent: 27 September 2010 16:02
To: Eric Robertson
Subject: Re: Problem Connecting to MySQL Database



$dsn="DBI:mysqlPP:host=localhost;database=$database";

(i.e, replace colon with semicolon after localhost)

--
Tim Bolshaw

timothybolshaw [at] gmail.com
Mobile: +66-(0)87 072 5009



Tim



I'm afraid this didn't work - I got the same error message. In fact I had
tested the connection string with the colon on the live server and this
worked OK but I need to use my own server for testing so that I can debug my
code in Komodo.



Eric.




------=_NextPart_000_0037_01CB5E7A.D45C4930
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<div>

<div>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>On Mon, Sep =
27, 2010 at
3:06 AM, Eric Robertson <<a =
href=3D"mailto:ericrob [at] blueyonder.co.uk">ericrob [at] blueyonder. co.uk</a>>=

wrote:<o:p></o:p></span></font></p>

<div link=3Dblue vlink=3Dpurple>

<div>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>I’m using a MacBook Pro running OS X =
10.6.4 and
I installed ActiveState Perl - I’m using version 5.8.8 at the =
moment. I
did this to make it easier to install some of the modules I wanted but
I’m not sure I wouldn’t have been better just to use the =
Perl that
comes with the Mac OS! </span></font><font color=3Dnavy><span
style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>The problem I have is that I can’t =
connect to a
MySQL database that I have on the MacBook, set up using MAMP PRO. When I =
was
running everything under Windows I used to have the DBD::mysql driver =
installed
but this doesn’t seem to be available for this build so I’m =
using
DBD::mysqlPP which I assume should work in the same way. However the =
connection
string fails when I try to connect using the =
following:</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";</span></fo=
nt><font
color=3Dnavy><span style=3D'color:navy'><br>
</span></font><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D DBI->connect($dsn, $username, $database, =
<font
color=3Dnavy><span =
style=3D'color:navy'>{</span></font></span></font><font
color=3Dnavy><span style=3D'color:navy'><br>
     </span></font><font size=3D2 face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>RaiseError =
=3D> 0,</span></font><font
color=3Dnavy><span style=3D'color:navy'><br>
     </span></font><font size=3D2 face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>PrintError =
=3D> 0}) ||
($error =3D "Got error '$DBI::errstr' when connecting to =
$dsn\n");</span></font><font
color=3Dnavy><span style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> and the error message =
is:</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> Got error 'Couldn't connect to
localhost:3306/tcp: IO::Socket::INET: connect: Connection refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when =
connecting
to<br>
DBI:mysqlPP:host=3Dlocalhost:database=3D$database.</span></font><o:p></o:=
p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> I’ve checked that I was using the =
correct
username and password, setting up and trying different ones, but without
success. I have a feeling that I read somewhere that there was a problem =
using
Perl to connect to a database set up under MAMP but can’t recall =
what the
problem was.</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> Can anyone suggest why this is not =
working.</span></font><o:p></o:p></p>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<p style=3D'margin-left:36.0pt'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'> Eric =
Robertson</span></font><o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:36.0pt;text-align:center'><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><b><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From:</spa=
n></font></b><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> Tim
Bolshaw [mailto:timothybolshaw [at] gmail.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> 27 September 2010 =
16:02<br>
<b><span style=3D'font-weight:bold'>To:</span></b> Eric Robertson<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: Problem =
Connecting to
MySQL Database</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>$dsn=3D"DBI:mysqlPP:host=3Dlocalhost<b><s=
pan
style=3D'font-weight:bold'>;</span></b>database=3D$database";<o:p></=
o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>(i.e, replace =
colon with
semicolon after localhost)<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>-- <br>
Tim Bolshaw<br>
<br>
<a =
href=3D"mailto:timothybolshaw [at] gmail.com">timothybolshaw [at] gmai l.com</a><br>=

<st1:place w:st=3D"on"><st1:City =
w:st=3D"on">Mobile</st1:City></st1:place>:
+66-(0)87 072 5009<o:p></o:p></span></font></p>

</div>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Tim<o:p></o:p></s=
pan></font></p>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>I’m afraid =
this
didn’t work – I got the same error message. In fact I had =
tested
the connection string with the colon on the live server and this worked =
OK but
I need to use my own server for testing so that I can debug my code in =
Komodo.<o:p></o:p></span></font></p>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p style=3D'margin:0cm;margin-bottom:.0001pt'><font size=3D2 =
color=3Dnavy face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Eric .<o:p></o:p><=
/span></font></p>

<p><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial;color:navy'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0037_01CB5E7A.D45C4930--



--===============0216709024==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0216709024==--
Eric Robertson [ Mo, 27 September 2010 20:33 ] [ ID #2048119 ]

RE: Problem Connecting to MySQL Database

This is a multi-part message in MIME format.

--===============1886945993==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0015_01CB5E9D.2BE7D080"

This is a multi-part message in MIME format.

------=_NextPart_000_0015_01CB5E9D.2BE7D080
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit



_____

From: Eric Robertson [mailto:ericrob [at] blueyonder.co.uk]
Sent: September 27, 2010 2:33 PM
To: 'Tim Bolshaw'
Cc: activeperl [at] listserv.ActiveState.com
Subject: RE: Problem Connecting to MySQL Database

On Mon, Sep 27, 2010 at 3:06 AM, Eric Robertson <ericrob [at] blueyonder.co.uk>
wrote:

I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState Perl
- I'm using version 5.8.8 at the moment. I did this to make it easier to
install some of the modules I wanted but I'm not sure I wouldn't have been
better just to use the Perl that comes with the Mac OS!

The problem I have is that I can't connect to a MySQL database that I have
on the MacBook, set up using MAMP PRO. When I was running everything under
Windows I used to have the DBD::mysql driver installed but this doesn't seem
to be available for this build so I'm using DBD::mysqlPP which I assume
should work in the same way. However the connection string fails when I try
to connect using the following:

$dsn = "DBI:mysqlPP:host=localhost:database=$database";
$dbh = DBI->connect($dsn, $username, $database, {
RaiseError => 0,
PrintError => 0}) || ($error = "Got error '$DBI::errstr' when
connecting to $dsn\n");

and the error message is:

Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
connect: Connection refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
connecting to
DBI:mysqlPP:host=localhost:database=$database.

I've checked that I was using the correct username and password, setting up
and trying different ones, but without success. I have a feeling that I read
somewhere that there was a problem using Perl to connect to a database set
up under MAMP but can't recall what the problem was.

Can anyone suggest why this is not working.

Eric Robertson

_____

From: Tim Bolshaw [mailto:timothybolshaw [at] gmail.com]
Sent: 27 September 2010 16:02
To: Eric Robertson
Subject: Re: Problem Connecting to MySQL Database



$dsn="DBI:mysqlPP:host=localhost;database=$database";

(i.e, replace colon with semicolon after localhost)

--
Tim Bolshaw

timothybolshaw [at] gmail.com
Mobile: +66-(0)87 072 5009



Tim



I'm afraid this didn't work - I got the same error message. In fact I had
tested the connection string with the colon on the live server and this
worked OK but I need to use my own server for testing so that I can debug my
code in Komodo.



Eric.

_____

From: Czarnowas, Andrew [mailto:Andrew.Czarnowas [at] thebeerstore.ca]
Sent: 27 September 2010 20:56
To: Eric Robertson
Subject: RE: Problem Connecting to MySQL Database



$dsn = "DBI:mysqlPP:host=localhost:database=$database";
$dbh = DBI->connect($dsn, $username, $database, {
RaiseError => 0,
PrintError => 0}) || ($error = "Got error '$DBI::errstr' when
connecting to $dsn\n");



Should this be password?



Andrew



Yes, it should - I did use an actual password here but had meant to replace
it with $password, so that isn't the problem unfortunately.

Eric.





No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.856 / Virus Database: 271.1.1/3160 - Release Date: 09/26/10
08:01:00



------=_NextPart_000_0015_01CB5E9D.2BE7D080
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
..shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"place"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"City"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<div>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

</div>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:36.0pt;text-align:center'><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabIndex=3D-1>

</span></font></div>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:
12.0pt;margin-left:36.0pt'><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> Eric
Robertson [mailto:ericrob [at] blueyonder.co.uk] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> September 27, 2010 =
2:33 PM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> 'Tim Bolshaw'<br>
<b><span style=3D'font-weight:bold'>Cc:</span></b>
activeperl [at] listserv.ActiveState.com<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: Problem =
Connecting to
MySQL Database</span></font><o:p></o:p></p>

<div>

<div>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>On Mon, Sep =
27, 2010 at
3:06 AM, Eric Robertson <<a =
href=3D"mailto:ericrob [at] blueyonder.co.uk">ericrob [at] blueyonder. co.uk</a>>=

wrote:<o:p></o:p></span></font></p>

<div vlink=3Dpurple link=3Dblue>

<div>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>I’m using a MacBook Pro running OS X =
10.6.4 and
I installed ActiveState Perl - I’m using version 5.8.8 at the =
moment. I
did this to make it easier to install some of the modules I wanted but
I’m not sure I wouldn’t have been better just to use the =
Perl that
comes with the Mac OS! </span></font><font color=3Dnavy><span
style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>The problem I have is that I can’t =
connect to a
MySQL database that I have on the MacBook, set up using MAMP PRO. When I =
was
running everything under Windows I used to have the DBD::mysql driver =
installed
but this doesn’t seem to be available for this build so I’m =
using
DBD::mysqlPP which I assume should work in the same way. However the =
connection
string fails when I try to connect using the =
following:</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:108.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";</span></fo=
nt><font
color=3Dnavy><span style=3D'color:navy'><br>
</span></font><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D DBI->connect($dsn, $username, $database, =
<font
color=3Dnavy><span =
style=3D'color:navy'>{</span></font></span></font><font
color=3Dnavy><span style=3D'color:navy'><br>
     </span></font><font size=3D2 face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>RaiseError =
=3D> 0,</span></font><font
color=3Dnavy><span style=3D'color:navy'><br>
     </span></font><font size=3D2 face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>PrintError =
=3D> 0}) ||
($error =3D "Got error '$DBI::errstr' when connecting to =
$dsn\n");</span></font><font
color=3Dnavy><span style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> and the error message =
is:</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> Got error 'Couldn't connect to
localhost:3306/tcp: IO::Socket::INET: connect: Connection refused at
/Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when =
connecting
to<br>
DBI:mysqlPP:host=3Dlocalhost:database=3D$database.</span></font><o:p></o:=
p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> I’ve checked that I was using the =
correct
username and password, setting up and trying different ones, but without
success. I have a feeling that I read somewhere that there was a problem =
using
Perl to connect to a database set up under MAMP but can’t recall =
what the
problem was.</span></font><o:p></o:p></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'> Can anyone suggest why this is not =
working.</span></font><o:p></o:p></p>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<div>

<p style=3D'margin-left:72.0pt'><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'> Eric =
Robertson</span></font><o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<div style=3D'margin-left:36.0pt'>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:36.0pt;text-align:center'><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabIndex=3D-1>

</span></font></div>

</div>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><b><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From:</spa=
n></font></b><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'> Tim
Bolshaw [mailto:timothybolshaw [at] gmail.com] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> 27 September 2010 =
16:02<br>
<b><span style=3D'font-weight:bold'>To:</span></b> Eric Robertson<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: Problem =
Connecting to
MySQL Database</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>$dsn=3D"DBI:mysqlPP:host=3Dlocalhost<b><s=
pan
style=3D'font-weight:bold'>;</span></b>database=3D$database";<o:p></=
o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>(i.e, replace =
colon with
semicolon after localhost)<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:72.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>-- <br>
Tim Bolshaw<br>
<br>
<a =
href=3D"mailto:timothybolshaw [at] gmail.com">timothybolshaw [at] gmai l.com</a><br>=

<st1:place w:st=3D"on"><st1:City =
w:st=3D"on">Mobile</st1:City></st1:place>:
+66-(0)87 072 5009<o:p></o:p></span></font></p>

</div>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Tim<o:p></o:p></s=
pan></font></p>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>I’m afraid =
this
didn’t work – I got the same error message. In fact I had =
tested
the connection string with the colon on the live server and this worked =
OK but
I need to use my own server for testing so that I can debug my code in =
Komodo.<o:p></o:p></span></font></p>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p>=
</span></font></p>

<p =
style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'><font size=3D2 color=3Dnavy =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Eric .<o:p></o:p><=
/span></font></p>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:36.0pt;text-align:center'><font
size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><b><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From:</spa=
n></font></b><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>
Czarnowas, Andrew [mailto:Andrew.Czarnowas [at] thebeerstore.ca] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> 27 September 2010 =
20:56<br>
<b><span style=3D'font-weight:bold'>To:</span></b> Eric Robertson<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: Problem =
Connecting to
MySQL Database</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:108.0pt'><font size=3D2 color=3Dblue face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";</span></fo=
nt><font
color=3Dnavy><span style=3D'color:navy'><br>
</span></font><font size=3D2 color=3Dblue face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>$dbh =3D
DBI->connect($dsn, $username, </span></font><font size=3D2 =
color=3Dred
face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;
color:red'>$database</span></font><font size=3D2 color=3Dblue =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial;color:blue'>, =
</span></font><font
size=3D2 color=3Dnavy face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;
font-family:Arial;color:navy'>{</span></font><font color=3Dnavy><span
style=3D'color:navy'><br>
     </span></font><font size=3D2 color=3Dblue =
face=3DArial><span
lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Rais eError
=3D> 0,</span></font><font color=3Dnavy><span =
style=3D'color:navy'><br>
     </span></font><font size=3D2 color=3Dblue =
face=3DArial><span
lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Prin tError
=3D> 0}) || ($error =3D "Got error '$DBI::errstr' when =
connecting to
$dsn\n");</span></font><font color=3Dnavy><span =
style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
color=3Dblue
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Shou ld  this&=
nbsp;be password?</span></font><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'> <o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D2 =
color=3Dblue
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Andr ew</span></fo=
nt><o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><font size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>

<p><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial;color:navy'>Yes, it should – I did use an actual password =
here but
had meant to replace it with $password, so that isn’t the problem
unfortunately.<o:p></o:p></span></font></p>

<p><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial;color:navy'>Eric.<o:p></o:p></span></font></p>

<p><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial;color:navy'><o:p> </o:p></span></font></p>

<p><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial;color:navy'><o:p> </o:p></span></font></p>

</div>

</body>

</html>
<P><FONT SIZE=3D2 FACE=3D"Arial">No virus found in this incoming =
message.<BR>
Checked by AVG - www.avg.com<BR>
Version: 9.0.856 / Virus Database: 271.1.1/3160 - Release Date: 09/26/10 =
08:01:00<BR>
</FONT></P>
------=_NextPart_000_0015_01CB5E9D.2BE7D080--


--===============1886945993==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1886945993==--
Eric Robertson [ Di, 28 September 2010 00:39 ] [ ID #2048182 ]

RE: Problem Connecting to MySQL Database

> -----Original Message-----
> From: Bill Luebkert [mailto:dbecoll [at] roadrunner.com]
> Sent: 27 September 2010 21:54
> To: Eric Robertson
> Subject: Re: Problem Connecting to MySQL Database
>
> On 9/26/2010 1:06 PM, Eric Robertson wrote:
> > I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState
> Perl - I'm using version 5.8.8 at the moment. I did this to make it easier
> to install some of the modules I wanted but I'm not sure I wouldn't have
> been better just to use the Perl that comes with the Mac OS!
> >
> > The problem I have is that I can't connect to a MySQL database that I
> have on the MacBook, set up using MAMP PRO. When I was running everything
> under Windows I used to have the DBD::mysql driver installed but this
> doesn't seem to be available for this build so I'm using DBD::mysqlPP
> which I assume should work in the same way. However the connection string
> fails when I try to connect using the following:
> >
> > $dsn = "DBI:mysqlPP:host=localhost:database=$database";
> >
> > $dbh = DBI->connect($dsn, $username, $database, {
> >
> > RaiseError => 0,
> >
> > PrintError => 0
> >
> > }) || ($error = "Got error '$DBI::errstr' when connecting to $dsn\n");
> >
> > and the error message is:
> >
> > Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
> connect: Connection refused at
> /Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
> connecting to
> > DBI:mysqlPP:host=localhost:database=$database.
> >
> > I've checked that I was using the correct username and password, setting
> up and trying different ones, but without success. I have a feeling that I
> read somewhere that there was a problem using Perl to connect to a
> database set up under MAMP but can't recall what the problem was.
> >
> > Can anyone suggest why this is not working.
>
> That sounds like the SQL server isn't listening on 3306. Do you have
> a utility program on OSX that can list the programs listening on a
> port (like netstat on Windoze) and see if 3306 has a listener attached ?
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.856 / Virus Database: 271.1.1/3160 - Release Date: 09/26/10
> 08:01:00

Many thanks for this comment. I'm afraid I don't know how to do this on the
Mac but will try to find out.

Eric.


_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Eric Robertson [ Di, 28 September 2010 00:44 ] [ ID #2048183 ]

RE: Problem Connecting to MySQL Database

Mac is basically unix, use `netstat -an`

________________________________________
From: activeperl-bounces [at] listserv.ActiveState.com [activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Eric Robertson [ericrob [at] blueyonder.co.uk]
Sent: Monday, September 27, 2010 3:44 PM
To: 'Bill Luebkert'
Cc: activeperl [at] listserv.ActiveState.com
Subject: RE: Problem Connecting to MySQL Database

> -----Original Message-----
> From: Bill Luebkert [mailto:dbecoll [at] roadrunner.com]
> Sent: 27 September 2010 21:54
> To: Eric Robertson
> Subject: Re: Problem Connecting to MySQL Database
>
> On 9/26/2010 1:06 PM, Eric Robertson wrote:
> > I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState
> Perl - I'm using version 5.8.8 at the moment. I did this to make it easier
> to install some of the modules I wanted but I'm not sure I wouldn't have
> been better just to use the Perl that comes with the Mac OS!
> >
> > The problem I have is that I can't connect to a MySQL database that I
> have on the MacBook, set up using MAMP PRO. When I was running everything
> under Windows I used to have the DBD::mysql driver installed but this
> doesn't seem to be available for this build so I'm using DBD::mysqlPP
> which I assume should work in the same way. However the connection string
> fails when I try to connect using the following:
> >
> > $dsn = "DBI:mysqlPP:host=localhost:database=$database";
> >
> > $dbh = DBI->connect($dsn, $username, $database, {
> >
> > RaiseError => 0,
> >
> > PrintError => 0
> >
> > }) || ($error = "Got error '$DBI::errstr' when connecting to $dsn\n");
> >
> > and the error message is:
> >
> > Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
> connect: Connection refused at
> /Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
> connecting to
> > DBI:mysqlPP:host=localhost:database=$database.
> >
> > I've checked that I was using the correct username and password, setting
> up and trying different ones, but without success. I have a feeling that I
> read somewhere that there was a problem using Perl to connect to a
> database set up under MAMP but can't recall what the problem was.
> >
> > Can anyone suggest why this is not working.
>
> That sounds like the SQL server isn't listening on 3306. Do you have
> a utility program on OSX that can list the programs listening on a
> port (like netstat on Windoze) and see if 3306 has a listener attached ?
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.856 / Virus Database: 271.1.1/3160 - Release Date: 09/26/10
> 08:01:00

Many thanks for this comment. I'm afraid I don't know how to do this on the
Mac but will try to find out.

Eric.


_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Jeff Saxton [ Di, 28 September 2010 01:45 ] [ ID #2048184 ]

Re: Problem Connecting to MySQL Database

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1512044859==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature";
boundary="------------enig2031407EF0C9A70281FE852A"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig2031407EF0C9A70281FE852A
Content-Type: multipart/alternative;
boundary="------------070808070607020106060606"

This is a multi-part message in MIME format.
--------------070808070607020106060606
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

First things first:
a)locate mysql's configuration file my.cnf normally under /etc , make
sure that the lineskip_networking does not appear in it !
b)comment it out if it's in the file.
c) Restart mysql
d)telnet to port 3306 manually and see if the server answers the connecti=
on.

if all of the above works then you are go !

On 27/9/2010 9:33 ??, Eric Robertson wrote:
>
> On Mon, Sep 27, 2010 at 3:06 AM, Eric Robertson
> <ericrob [at] blueyonder.co.uk <mailto:ericrob [at] blueyonder.co.uk>> wrote:
>
> I'm using a MacBook Pro running OS X 10.6.4 and I installed
> ActiveState Perl - I'm using version 5.8.8 at the moment. I did this
> to make it easier to install some of the modules I wanted but I'm not
> sure I wouldn't have been better just to use the Perl that comes with
> the Mac OS!
>
> The problem I have is that I can't connect to a MySQL database that I
> have on the MacBook, set up using MAMP PRO. When I was running
> everything under Windows I used to have the DBD::mysql driver
> installed but this doesn't seem to be available for this build so I'm
> using DBD::mysqlPP which I assume should work in the same way. However
> the connection string fails when I try to connect using the following:
>
> $dsn =3D "DBI:mysqlPP:host=3Dlocalhost:database=3D$database";
>


--------------070808070607020106060606
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content=3D"text/html; charset=3DISO-8859-1"
http-equiv=3D"Content-Type">
<title></title>
</head>
<body text=3D"#000000" bgcolor=3D"#ffffff">
First things first: <br>
a)locate mysql's configuration file my.cnf normally under /etc ,
make sure that the lineskip_networking does not appear in it ! <br>
b)comment it out if it's in the file.<br>
c) Restart mysql<br>
d)telnet to port 3306 manually and see if the server answers the
connection.<br>
<br>
if all of the above works then you are go !<br>
<br>
On 27/9/2010 9:33 μμ, Eric Robertson wrote:
<blockquote cite=3D"mid:A8ABEA56D7924E8AAB876414C65FD6E0 [at] macbookXP"
type=3D"cite">
<meta http-equiv=3D"Content-Type" content=3D"text/html;
charset=3DISO-8859-1">
<meta name=3D"Generator" content=3D"Microsoft Word 11 (filtered
medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
=2Eshape {behavior:url(#default#VML);}
</style>
<![endif]--><o:smarttagtype
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"City">
<o:smarttagtype
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
<div class=3D"Section1">
<div>
<div>
<p class=3D"MsoNormal" style=3D"margin-left: 36pt;"><font=

size=3D"3" face=3D"Times New Roman"><span
style=3D"font-size: 12pt;">On Mon, Sep 27, 2010 at
3:06 AM, Eric Robertson <<a
moz-do-not-send=3D"true"
href=3D"mailto:ericrob [at] blueyonder.co.uk">ericrob [at] =
blueyonder.co.uk</a>>
wrote:<o:p></o:p></span></font></p>
<div link=3D"blue" vlink=3D"purple">
<div>
<p class=3D"MsoNormal" style=3D"margin-left: 36pt;"><=
font
size=3D"2" face=3D"Arial"><span style=3D"font-siz=
e:
10pt; font-family: Arial;" lang=3D"EN-GB">IR=
17;m
using a MacBook Pro running OS X 10.6.4 and
I installed ActiveState Perl - I’m using
version 5.8.8 at the moment. I
did this to make it easier to install some of
the modules I wanted but
I’m not sure I wouldn’t have been b=
etter just
to use the Perl that
comes with the Mac OS! </span></font><font=

color=3D"navy"><span style=3D"color: navy;"><o:p>=
</o:p></span></font></p>
<p class=3D"MsoNormal" style=3D"margin-left: 36pt;"><=
font
size=3D"2" face=3D"Arial"><span style=3D"font-siz=
e:
10pt; font-family: Arial;" lang=3D"EN-GB">The
problem I have is that I can’t connect to=
a
MySQL database that I have on the MacBook, set
up using MAMP PRO. When I was
running everything under Windows I used to
have the DBD::mysql driver installed
but this doesn’t seem to be available for=
this
build so I’m using
DBD::mysqlPP which I assume should work in the
same way. However the connection
string fails when I try to connect using the
following:</span></font><o:p></o:p></p>
<p class=3D"MsoNormal" style=3D"margin-left: 72pt;"><=
font
size=3D"2" face=3D"Arial"><span style=3D"font-siz=
e:
10pt; font-family: Arial;" lang=3D"EN-GB">$dsn =
=3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";</span></font><br>
</p>
</div>
</div>
</div>
</div>
</div>
</o:smarttagtype></o:smarttagtype></blockquote>
<br>
</body>
</html>

--------------070808070607020106060606--

--------------enig2031407EF0C9A70281FE852A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMoYGmAAoJEAa9bq/jDq5leJAH/iyKqgGWNV+NsRdTkMtm 2vx/
3Ia86N42+B7h6OpH1lu/SMgKH1a0o4pO98sY6dFmFKdD61Tdhei1mofDz7nN XnFW
CME3bjD4nzHSHejZTWefCfLfrSZr6ZRbR2paR3lFN/DuCvydtgaMKxh2jZ4K g7Ee
Q1iHuDLf5X3OvbYGDoxLtralAFOEWDzN9p6s3jWhQbB8YppfNBjRsNZasZN5 r5CZ
0dlFXcoDU3yKlTb0gC7q3guT935EzQA/MgLN1ur/cvEhvPlU8Hf1EqpCrzV+ BNh0
y9h0CLKuegsdgyajOSg009SR3AP2NZweUem9IrNgLU65kaKbYaNT85Of/moY gYc=
=yyhw
-----END PGP SIGNATURE-----

--------------enig2031407EF0C9A70281FE852A--

--===============1512044859==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1512044859==--
Angelos Karageorgiou [ Di, 28 September 2010 07:48 ] [ ID #2048185 ]

RE: Problem Connecting to MySQL Database

> -----Original Message-----
> From: Jeff Saxton [mailto:jeff_saxton [at] bigfix.com]
> Sent: 28 September 2010 00:46
> To: Eric Robertson; 'Bill Luebkert'
> Cc: activeperl [at] listserv.ActiveState.com
> Subject: RE: Problem Connecting to MySQL Database
>
> Mac is basically unix, use `netstat -an`
>
> ________________________________________
> From: activeperl-bounces [at] listserv.ActiveState.com [activeperl-
> bounces [at] listserv.ActiveState.com] On Behalf Of Eric Robertson
> [ericrob [at] blueyonder.co.uk]
> Sent: Monday, September 27, 2010 3:44 PM
> To: 'Bill Luebkert'
> Cc: activeperl [at] listserv.ActiveState.com
> Subject: RE: Problem Connecting to MySQL Database
>
> > -----Original Message-----
> > From: Bill Luebkert [mailto:dbecoll [at] roadrunner.com]
> > Sent: 27 September 2010 21:54
> > To: Eric Robertson
> > Subject: Re: Problem Connecting to MySQL Database
> >
> > On 9/26/2010 1:06 PM, Eric Robertson wrote:
> > > I'm using a MacBook Pro running OS X 10.6.4 and I installed
> ActiveState
> > Perl - I'm using version 5.8.8 at the moment. I did this to make it
> easier
> > to install some of the modules I wanted but I'm not sure I wouldn't have
> > been better just to use the Perl that comes with the Mac OS!
> > >
> > > The problem I have is that I can't connect to a MySQL database that I
> > have on the MacBook, set up using MAMP PRO. When I was running
> everything
> > under Windows I used to have the DBD::mysql driver installed but this
> > doesn't seem to be available for this build so I'm using DBD::mysqlPP
> > which I assume should work in the same way. However the connection
> string
> > fails when I try to connect using the following:
> > >
> > > $dsn = "DBI:mysqlPP:host=localhost:database=$database";
> > >
> > > $dbh = DBI->connect($dsn, $username, $database, {
> > >
> > > RaiseError => 0,
> > >
> > > PrintError => 0
> > >
> > > }) || ($error = "Got error '$DBI::errstr' when connecting to $dsn\n");
> > >
> > > and the error message is:
> > >
> > > Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
> > connect: Connection refused at
> > /Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
> > connecting to
> > > DBI:mysqlPP:host=localhost:database=$database.
> > >
> > > I've checked that I was using the correct username and password,
> setting
> > up and trying different ones, but without success. I have a feeling that
> I
> > read somewhere that there was a problem using Perl to connect to a
> > database set up under MAMP but can't recall what the problem was.
> > >
> > > Can anyone suggest why this is not working.
> >
> > That sounds like the SQL server isn't listening on 3306. Do you have
> > a utility program on OSX that can list the programs listening on a
> > port (like netstat on Windoze) and see if 3306 has a listener attached ?
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 9.0.856 / Virus Database: 271.1.1/3160 - Release Date: 09/26/10
> > 08:01:00
>
> Many thanks for this comment. I'm afraid I don't know how to do this on
> the
> Mac but will try to find out.
>
> Eric.

Thank you both for that. The problem was indeed that the SQL server wasn't
listening on port 3306. Andrew Czarnowas pointed out that the MAMP control
panel allows you to change the ports and having made that change everything
works like magic!

Eric



_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Eric Robertson [ Mi, 29 September 2010 11:40 ] [ ID #2048241 ]

RE: Problem Connecting to MySQL Database

This is a multi-part message in MIME format.

--===============1326709384==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0004_01CB5FC4.23A47400"

This is a multi-part message in MIME format.

------=_NextPart_000_0004_01CB5FC4.23A47400
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

>>On Mon, Sep 27, 2010 at 3:06 AM, Eric Robertson <ericrob [at] blueyonder.co.uk>
wrote:

>>

>>I'm using a MacBook Pro running OS X 10.6.4 and I installed ActiveState
Perl - I'm using version 5.8.8 at the moment. I did this to make it easier
to install some of the modules I wanted but I'm not sure I wouldn't have
been better just to use >>the Perl that comes with the Mac OS!

>>

>>The problem I have is that I can't connect to a MySQL database that I have
on the MacBook, set up using MAMP PRO. When I was running everything under
Windows I used to have the DBD::mysql driver installed but this doesn't seem
to >>be available for this build so I'm using DBD::mysqlPP which I assume
should work in the same way. However the connection string fails when I try
to connect using the following:

>>

>> $dsn = "DBI:mysqlPP:host=localhost:database=$database";



>From: Angelos Karageorgiou [mailto:angelos [at] unix.gr]
>Sent: 28 September 2010 06:48
>To: Eric Robertson
>Cc: activeperl [at] listserv.ActiveState.com
>Subject: Re: Problem Connecting to MySQL Database

>

>First things first:
>a)locate mysql's configuration file my.cnf normally under /etc , make sure
that the lineskip_networking does not appear in it !
>b)comment it out if it's in the file.
>c) Restart mysql
>d)telnet to port 3306 manually and see if the server answers the
connection.
>
>if all of the above works then you are go !



Thanks Angelos - you'll see from my other posting that it was the listening
port that was the problem and that there was an easy way of fixing this
using the MAMP control panel.



Eric

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.856 / Virus Database: 271.1.1/3163 - Release Date: 09/27/10
18:56:00



------=_NextPart_000_0004_01CB5FC4.23A47400
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
[at] page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=3Dwhite lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<div>

<p class=3DMsoNormal><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>>></span></font>On Mon, Sep =
27, 2010
at 3:06 AM, Eric Robertson <<a =
href=3D"mailto:ericrob [at] blueyonder.co.uk"
moz-do-not-send=3Dtrue>ericrob [at] blueyonder.co.uk</a>> =
wrote:<o:p></o:p></p>

<u1:p></u1:p>

<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt'>>><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>>I</span><=
/font><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>’m
using a MacBook Pro running OS X 10.6.4 and I installed ActiveState Perl =
-
I’m using version 5.8.8 at the moment. I did this to make it =
easier to
install some of the modules I wanted but I’m not sure I =
wouldn’t
have been better just to use </span></font><font size=3D2 color=3Dnavy =
face=3DArial><span
lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>></span></=
font><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>the
Perl that comes with the Mac OS! <o:p></o:p></span></font></p>

<u1:p></u1:p>

<p class=3DMsoNormal><font size=3D2 color=3Dblack face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial'>>></span></font><o:p>&=
nbsp;</o:p></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>></span></=
font><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>The
problem I have is that I can’t connect to a MySQL database that I =
have on
the MacBook, set up using MAMP PRO. When I was running everything under =
Windows
I used to have the DBD::mysql driver installed but this doesn’t =
seem to </span></font><font
size=3D2 color=3Dnavy face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;
font-family:Arial;color:navy'>>></span></font><font size=3D2 =
face=3DArial><span
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>be available =
for this
build so I’m using DBD::mysqlPP which I assume should work in the =
same
way. However the connection string fails when I try to connect using the
following:<o:p></o:p></span></font><u1:p></u1:p></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblack face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial'>>></span></font><o:p>&=
nbsp;</o:p></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>> &nb=
sp;      </span></font><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>$dsn
=3D =
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";</span></fo=
nt><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'><o:p> </o:p></span></font></p>=


</u1:smarttagtype></u1:smarttagtype>

<p class=3DMsoNormal><b><font size=3D2 color=3Dblack face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma;color:windowtex t;font-weight=
:bold'>>From:</span></font></b><font
size=3D2 color=3Dblack face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma;
color:windowtext'> Angelos Karageorgiou [mailto:angelos [at] unix.gr] <br>
><b><span style=3D'font-weight:bold'>Sent:</span></b> 28 September =
2010 06:48<br>
><b><span style=3D'font-weight:bold'>To:</span></b> Eric =
Robertson<br>
><b><span style=3D'font-weight:bold'>Cc:</span></b>
activeperl [at] listserv.ActiveState.com<br>
><b><span style=3D'font-weight:bold'>Subject:</span></b> Re: Problem
Connecting to MySQL Database</span></font><font color=3Dblack><span
style=3D'color:windowtext'><o:p></o:p></span></font></p>

</div>

<p class=3DMsoNormal><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>></span></font><o:p> </o:p>=
</p>

<p class=3DMsoNormal><font size=3D3 color=3Dnavy face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:navy'>></span></font>First things =
first: <br>
<font color=3Dnavy><span style=3D'color:navy'>></span></font>a)locate =
mysql's
configuration file my.cnf normally under /etc , make sure that the
lineskip_networking does not appear in it ! <br>
<font color=3Dnavy><span =
style=3D'color:navy'>></span></font>b)comment it out if
it's in the file.<br>
<font color=3Dnavy><span style=3D'color:navy'>></span></font>c) =
Restart mysql<br>
<font color=3Dnavy><span style=3D'color:navy'>></span></font>d)telnet =
to port
3306 manually and see if the server answers the connection.<br>
<font color=3Dnavy><span style=3D'color:navy'>></span></font><br>
<font color=3Dnavy><span style=3D'color:navy'>></span></font>if all =
of the above
works then you are go !<br>
<br>
<font color=3Dnavy><span =
style=3D'color:navy'><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Thanks Angelos – you’ll =
see
from my other posting that it was the listening port that was the =
problem and
that there was an easy way of fixing this using the MAMP control =
panel.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Eric<o:p></o:p></span></font></p>

</div>

</body>

</html>
<P><FONT SIZE=3D2 FACE=3D"Arial">No virus found in this incoming =
message.<BR>
Checked by AVG - www.avg.com<BR>
Version: 9.0.856 / Virus Database: 271.1.1/3163 - Release Date: 09/27/10 =
18:56:00<BR>
</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial"> </FONT> </P>
------=_NextPart_000_0004_01CB5FC4.23A47400--



--===============1326709384==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1326709384==--
Eric Robertson [ Mi, 29 September 2010 11:50 ] [ ID #2048242 ]

RE: Problem Connecting to MySQL Database

> > On 9/26/2010 1:06 PM, Eric Robertson wrote:
> > I'm using a MacBook Pro running OS X 10.6.4 and I installed
> > ActiveState
> > Perl - I'm using version 5.8.8 at the moment. I did this to make it
> > easier to install some of the modules I wanted but I'm not sure I
> > wouldn't have been better just to use the Perl that comes with the Mac
> > OS!
> >
> > The problem I have is that I can't connect to a MySQL database that
> > I
> > have on the MacBook, set up using MAMP PRO. When I was running
> > everything under Windows I used to have the DBD::mysql driver
> > installed but this doesn't seem to be available for this build so I'm
> > using DBD::mysqlPP which I assume should work in the same way. However
>
> > the connection string fails when I try to connect using the following:
> >
> > $dsn = "DBI:mysqlPP:host=localhost:database=$database";
> >
> > $dbh = DBI->connect($dsn, $username, $database, {
> >
> > RaiseError => 0,
> >
> > PrintError => 0
> >
> > }) || ($error = "Got error '$DBI::errstr' when connecting to
> > $dsn\n");
> >
> > and the error message is:
> >
> > Got error 'Couldn't connect to localhost:3306/tcp: IO::Socket::INET:
> > connect: Connection refused at
> > /Users/(myname)/Library/ActivePerl/lib/DBD/mysqlPP.pm line 109' when
> > connecting to
> > DBI:mysqlPP:host=localhost:database=$database.
> >
> > I've checked that I was using the correct username and password,
> > setting
> > up and trying different ones, but without success. I have a feeling
> > that I read somewhere that there was a problem using Perl to connect
> > to a database set up under MAMP but can't recall what the problem was.
> >
> > Can anyone suggest why this is not working.
>
> -----Original Message-----
> From: Czarnowas, Andrew [mailto:Andrew.Czarnowas [at] thebeerstore.ca]
> Sent: 28 September 2010 14:45
> To: Eric Robertson
> Subject: RE: Problem Connecting to MySQL Database
>
> MAMP & MAMP PRO uses Default port 8889 for mysql. You can also find the
> ports in MAMP application's Preferences Panel
>
> Here are some FAQs for MAMP & MAMP PRO
> http://www.mamp.info/en/documentation/faq.html#q6
>
> Andrew
>

Many thanks Andrew - I should have tried looking at the MAMP FAQs! I did as
you suggest and changing the server's listening port to 3306 has solved the
problem.

I can now get with debugging my code using the MySQL database on my local
server.

Eric


_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Eric Robertson [ Mi, 29 September 2010 12:02 ] [ ID #2048243 ]
Perl » gmane.comp.lang.perl.active-perl » Problem Connecting to MySQL Database

Vorheriges Thema: Restoring Dumped Values
Nächstes Thema: Best way to compare to files in Perl