Problem Connecting to MySQL Database

Problem Connecting to MySQL Database

am 26.09.2010 22:06:50 von Eric Robertson

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

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">


charset=3Dus-ascii">









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!



style=3D'font-size:
10.0pt;font-family:Arial'> 



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:



style=3D'font-size:
10.0pt;font-family:Arial'> 



face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";=



face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>$dbh =3D
DBI->connect($dsn, $username, $database, =
{



face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>   =
RaiseError
=3D> 0,



face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>   =
PrintError
=3D> 0



face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>}) || ($error =
=3D "Got
error '$DBI::errstr' when connecting to =
$dsn\n");



style=3D'font-size:
10.0pt;font-family:Arial'> 



style=3D'font-size:
10.0pt;font-family:Arial'>and the error message =
is:



style=3D'font-size:
10.0pt;font-family:Arial'> 



face=3DArial> 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

DBI:mysqlPP:host=3Dlocalhost:database=3D$database. t>



style=3D'font-size:
10.0pt;font-family:Arial'> 



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.



style=3D'font-size:
10.0pt;font-family:Arial'> 



style=3D'font-size:
10.0pt;font-family:Arial'>Can anyone suggest why this is not =
working.

































style=3D'font-size:10.0pt;
font-family:Arial'> 



style=3D'font-size:10.0pt;
font-family:Arial'>Eric Robertson

































lang=3DEN-GB
style=3D'font-size:12.0pt'> 









------=_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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0785148211==--

RE: Problem Connecting to MySQL Database

am 27.09.2010 20:33:14 von Eric Robertson

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
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@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@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

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">


charset=3Dus-ascii">

namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"City"/>
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>













face=3D"Times New Roman">On Mon, Sep =
27, 2010 at
3:06 AM, Eric Robertson < href=3D"mailto:ericrob@blueyonder.co.uk">ericrob@blueyonder. co.uk>=

wrote:







style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> 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! 
style=3D'color:navy'>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> 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:



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";
nt> color=3Dnavy>

style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D DBI->connect($dsn, $username, $database, =
color=3Dnavy> style=3D'color:navy'>{
color=3Dnavy>

    
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>RaiseError =
=3D> 0,
color=3Dnavy>

    
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");
color=3Dnavy>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'> and the error message =
is:



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> 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

DBI:mysqlPP:host=3Dlocalhost:database=3D$database.
p>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> 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.



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:36.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'> Can anyone suggest why this is not =
working.

































style=3D'font-size:
10.0pt;font-family:Arial'> Eric =
Robertson







































style=3D'margin-left:36.0pt;text-align:center'> size=3D3 face=3D"Times New Roman">






face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From: n> size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'> Tim
Bolshaw [mailto:timothybolshaw@gmail.com]

Sent: 27 September 2010 =
16:02

To: Eric Robertson

Subject: Re: Problem =
Connecting to
MySQL Database



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



face=3D"Times New Roman"> style=3D'font-size:12.0pt'>$dsn=3D"DBI:mysqlPP:host=3Dlocalhost pan
style=3D'font-weight:bold'>;
database=3D$database"; o:p>



face=3D"Times New Roman">(i.e, replace =
colon with
semicolon after localhost)



face=3D"Times New Roman">--

Tim Bolshaw



href=3D"mailto:timothybolshaw@gmail.com">timothybolshaw@gmai l.com
=

w:st=3D"on">Mobile:
+66-(0)87 072 5009





color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'> =



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Tim pan>



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'> =



color=3Dnavy face=3DArial> 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.



color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'> =



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



style=3D'font-size:10.0pt;font-family:
Arial;color:navy'> 









------=_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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0216709024==--

RE: Problem Connecting to MySQL Database

am 28.09.2010 00:39:04 von Eric Robertson

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@blueyonder.co.uk]
Sent: September 27, 2010 2:33 PM
To: 'Tim Bolshaw'
Cc: activeperl@listserv.ActiveState.com
Subject: RE: Problem Connecting to MySQL Database

On Mon, Sep 27, 2010 at 3:06 AM, 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.

Eric Robertson

_____

From: Tim Bolshaw [mailto:timothybolshaw@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@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@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

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">


charset=3Dus-ascii">

namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"place"/>
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"City"/>











face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 





style=3D'margin-left:36.0pt;text-align:center'> size=3D3 face=3D"Times New Roman">






style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:
12.0pt;margin-left:36.0pt'> style=3D'font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:
size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'> Eric
Robertson [mailto:ericrob@blueyonder.co.uk]

Sent: September 27, 2010 =
2:33 PM

To: 'Tim Bolshaw'

Cc:
activeperl@listserv.ActiveState.com

Subject: RE: Problem =
Connecting to
MySQL Database







face=3D"Times New Roman">On Mon, Sep =
27, 2010 at
3:06 AM, Eric Robertson < href=3D"mailto:ericrob@blueyonder.co.uk">ericrob@blueyonder. co.uk>=

wrote:







style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> 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! 
style=3D'color:navy'>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> 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:



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:108.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";
nt> color=3Dnavy>

style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D DBI->connect($dsn, $username, $database, =
color=3Dnavy> style=3D'color:navy'>{
color=3Dnavy>

    
lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial'>RaiseError =
=3D> 0,
color=3Dnavy>

    
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");
color=3Dnavy>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'> and the error message =
is:



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> 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

DBI:mysqlPP:host=3Dlocalhost:database=3D$database.
p>



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> 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.



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:72.0pt'> style=3D'font-size:
10.0pt;font-family:Arial'> Can anyone suggest why this is not =
working.

































style=3D'font-size:
10.0pt;font-family:Arial'> Eric =
Robertson









































style=3D'margin-left:36.0pt;text-align:center'> size=3D3 face=3D"Times New Roman">








face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From: n> size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'> Tim
Bolshaw [mailto:timothybolshaw@gmail.com]

Sent: 27 September 2010 =
16:02

To: Eric Robertson

Subject: Re: Problem =
Connecting to
MySQL Database



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



face=3D"Times New Roman"> style=3D'font-size:12.0pt'>$dsn=3D"DBI:mysqlPP:host=3Dlocalhost pan
style=3D'font-weight:bold'>;
database=3D$database"; o:p>



face=3D"Times New Roman">(i.e, replace =
colon with
semicolon after localhost)



face=3D"Times New Roman">--

Tim Bolshaw



href=3D"mailto:timothybolshaw@gmail.com">timothybolshaw@gmai l.com
=

w:st=3D"on">Mobile:
+66-(0)87 072 5009





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



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



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



style=3D'mso-margin-top-alt:0cm;margin-right:0cm;margin-bott om:0cm;margin=
-left:
36.0pt;margin-bottom:.0001pt'> face=3DArial> 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.



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



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



style=3D'margin-left:36.0pt;text-align:center'> size=3D3 face=3D"Times New Roman">






face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bol d'>From: n> size=3D2 face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma'>
Czarnowas, Andrew [mailto:Andrew.Czarnowas@thebeerstore.ca]

Sent: 27 September 2010 =
20:56

To: Eric Robertson

Subject: RE: Problem =
Connecting to
MySQL Database



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
margin-left:108.0pt'> lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>$dsn =3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";
nt> color=3Dnavy>

lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>$dbh =3D
DBI->connect($dsn, $username,
color=3Dred
face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;
color:red'>$database
face=3DArial> lang=3DEN-GB style=3D'font-size:10.0pt;font-family:Arial;color:blue'>, =
size=3D2 color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;
font-family:Arial;color:navy'>{
style=3D'color:navy'>

    
face=3DArial> lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Rais eError
=3D> 0,
style=3D'color:navy'>

    
face=3DArial> 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");
style=3D'color:navy'>



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



color=3Dblue
face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Shou ld  this&=
nbsp;be password?



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



color=3Dblue
face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:blue'>Andr ew nt>



face=3D"Times New Roman"> style=3D'font-size:12.0pt'> 



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.



style=3D'font-size:10.0pt;font-family:
Arial;color:navy'>Eric.



style=3D'font-size:10.0pt;font-family:
Arial;color:navy'> 



style=3D'font-size:10.0pt;font-family:
Arial;color:navy'> 








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--


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

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1886945993==--

RE: Problem Connecting to MySQL Database

am 28.09.2010 00:44:43 von Eric Robertson

> -----Original Message-----
> From: Bill Luebkert [mailto:dbecoll@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Problem Connecting to MySQL Database

am 28.09.2010 01:45:53 von Jeff Saxton

Mac is basically unix, use `netstat -an`

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

> -----Original Message-----
> From: Bill Luebkert [mailto:dbecoll@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Problem Connecting to MySQL Database

am 28.09.2010 07:48:18 von Angelos Karageorgiou

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
> > 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!=20
>
> 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




http-equiv=3D"Content-Type">



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 !



On 27/9/2010 9:33 μμ, Eric Robertson wrote:

type=3D"cite">
charset=3DISO-8859-1">
medium)">
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"City">
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place">






size=3D"3" face=3D"Times New Roman"> style=3D"font-size: 12pt;">On Mon, Sep 27, 2010 at
3:06 AM, Eric Robertson < moz-do-not-send=3D"true"
href=3D"mailto:ericrob@blueyonder.co.uk">ericrob@=
blueyonder.co.uk>
wrote:




<=
font
size=3D"2" face=3D"Arial"> 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! 

color=3D"navy">=


<=
font
size=3D"2" face=3D"Arial"> 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:


<=
font
size=3D"2" face=3D"Arial"> e:
10pt; font-family: Arial;" lang=3D"EN-GB">$dsn =
=3D
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";














--------------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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1512044859==--

RE: Problem Connecting to MySQL Database

am 29.09.2010 11:40:39 von Eric Robertson

> -----Original Message-----
> From: Jeff Saxton [mailto:jeff_saxton@bigfix.com]
> Sent: 28 September 2010 00:46
> To: Eric Robertson; 'Bill Luebkert'
> Cc: activeperl@listserv.ActiveState.com
> Subject: RE: Problem Connecting to MySQL Database
>
> Mac is basically unix, use `netstat -an`
>
> ________________________________________
> From: activeperl-bounces@listserv.ActiveState.com [activeperl-
> bounces@listserv.ActiveState.com] On Behalf Of Eric Robertson
> [ericrob@blueyonder.co.uk]
> Sent: Monday, September 27, 2010 3:44 PM
> To: 'Bill Luebkert'
> Cc: activeperl@listserv.ActiveState.com
> Subject: RE: Problem Connecting to MySQL Database
>
> > -----Original Message-----
> > From: Bill Luebkert [mailto:dbecoll@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Problem Connecting to MySQL Database

am 29.09.2010 11:50:32 von Eric Robertson

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
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@unix.gr]
>Sent: 28 September 2010 06:48
>To: Eric Robertson
>Cc: activeperl@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

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">


charset=3Dus-ascii">











Roman"> style=3D'font-size:12.0pt;color:navy'>>>On Mon, Sep =
27, 2010
at 3:06 AM, Eric Robertson < href=3D"mailto:ericrob@blueyonder.co.uk"
moz-do-not-send=3Dtrue>ericrob@blueyonder.co.uk
> =
wrote:





Roman"> style=3D'font-size:12.0pt'>>> 



lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>>I
<=
/font> size=3D2 face=3DArial> 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
face=3DArial> lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>> font> size=3D2 face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>the
Perl that comes with the Mac OS! 





lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial'>>>
&=
nbsp;



lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>>
font> size=3D2 face=3DArial> 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
size=3D2 color=3Dnavy face=3DArial> style=3D'font-size:10.0pt;
font-family:Arial;color:navy'>>>
face=3DArial> 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:



lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial'>>>
&=
nbsp;



lang=3DEN-GB
style=3D'font-size:10.0pt;font-family:Arial;color:navy'>>> &nb=
sp;     
size=3D2 face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>$dsn
=3D =
"DBI:mysqlPP:host=3Dlocalhost:database=3D$database";
nt>



Roman"> style=3D'font-size:12.0pt;color:navy'> 

=




style=3D'font-size:10.0pt;font-family:Tahoma;color:windowtex t;font-weight=
:bold'>>From:
size=3D2 color=3Dblack face=3DTahoma> style=3D'font-size:10.0pt;font-family:Tahoma;
color:windowtext'> Angelos Karageorgiou [mailto:angelos@unix.gr]

>Sent: 28 September =
2010 06:48

>To: Eric =
Robertson

>Cc:
activeperl@listserv.ActiveState.com

>Subject: Re: Problem
Connecting to MySQL Database
style=3D'color:windowtext'>





Roman"> style=3D'font-size:12.0pt;color:navy'>> =



Roman"> style=3D'font-size:12.0pt;color:navy'>>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 !

style=3D'color:navy'>>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 !



style=3D'color:navy'>



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.



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>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--



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

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1326709384==--

RE: Problem Connecting to MySQL Database

am 29.09.2010 12:02:39 von Eric Robertson

> > 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@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@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs