script not able to connect

script not able to connect

am 14.08.2004 07:21:18 von Jeremy Morris

I am quite new at using perl and mysql. I just installed
the DBI and DBD packages, and was required to download the
header files to do so. Once all these things were
installed, I tried a simple script to see if it works.
Here is the code I tried:

#!/usr/bin/perl -w
use strict;
use DBI; (I also tried use DBD::mysql, same effect)

my $dsn = 'dbi:mysql:databasename:myhostname:3306';
my $user = 'myusername';
my $pswd = 'mypassword';

my $dbh = DBI->connect($dsn,$user,$pswd) or die 'try
again\n';

I get the follwing error message after running $> perl
filename.pl :
DBI
connect('databasename:myhostname:3306','myusername','...)
failed: Host 'myipaddress' is not allowed to connect to
this MySQL server at filename.pl line 9

So I went into webmin to see what was happening there;
whenever I try to look at something, I get the following
message:
HTTP/1.0 500 Perl execution failed Server: MiniServ/0.01
Date: Sat, 14 Aug 2004 05:22:14 GMT Content-type:
text/html Connection: close
Error - Perl execution failed

Can't use an undefined value as a HASH reference at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/m ysql.pm
line 113.

Does anyone know what is going on?

Thank you,
Jeremy

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 15.08.2004 14:12:00 von Jan Eden

Hi Jeremy,

Jeremy Morris wrote on 14.08.2004:

>I am quite new at using perl and mysql. I just installed=20
>the DBI and DBD packages, and was required to download the=20
>header files to do so. Once all these things were=20
>installed, I tried a simple script to see if it works.=20
> Here is the code I tried:
>
>#!/usr/bin/perl -w
>use strict;
>use DBI; (I also tried use DBD::mysql, same effect)
>
>my $dsn =3D 'dbi:mysql:databasename:myhostname:3306';
>my $user =3D 'myusername';
>my $pswd =3D 'mypassword';
>
>my $dbh =3D DBI->connect($dsn,$user,$pswd) or die 'try=20
>again\n';
>
>I get the follwing error message after running $> perl=20
>filename.pl :
>DBI=20
>connect('databasename:myhostname:3306','myusername','...)=2 0
>failed: Host 'myipaddress' is not allowed to connect to=20
>this MySQL server at filename.pl line 9

Did you set up the MySQL server yourself? Some ISPs offer MySQL databases w=
here access is restricted to their own webservers. This is a good thing fro=
m a security viewpoint, but in that case you have to connect to the webserv=
er via ssh and run your script directly from the remote server.

HTH,

Jan
--=20
Either this man is dead or my watch has stopped. - Groucho Marx

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: script not able to connect

am 15.08.2004 14:12:00 von Jan Eden

Hi Jeremy,

Jeremy Morris wrote on 14.08.2004:

>I am quite new at using perl and mysql. I just installed=20
>the DBI and DBD packages, and was required to download the=20
>header files to do so. Once all these things were=20
>installed, I tried a simple script to see if it works.=20
> Here is the code I tried:
>
>#!/usr/bin/perl -w
>use strict;
>use DBI; (I also tried use DBD::mysql, same effect)
>
>my $dsn =3D 'dbi:mysql:databasename:myhostname:3306';
>my $user =3D 'myusername';
>my $pswd =3D 'mypassword';
>
>my $dbh =3D DBI->connect($dsn,$user,$pswd) or die 'try=20
>again\n';
>
>I get the follwing error message after running $> perl=20
>filename.pl :
>DBI=20
>connect('databasename:myhostname:3306','myusername','...)=2 0
>failed: Host 'myipaddress' is not allowed to connect to=20
>this MySQL server at filename.pl line 9

Did you set up the MySQL server yourself? Some ISPs offer MySQL databases w=
here access is restricted to their own webservers. This is a good thing fro=
m a security viewpoint, but in that case you have to connect to the webserv=
er via ssh and run your script directly from the remote server.

HTH,

Jan
--=20
Either this man is dead or my watch has stopped. - Groucho Marx

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: script not able to connect

am 16.08.2004 16:56:40 von Jeremy Morris

On Sun, 15 Aug 2004 14:12:00 +0200
Jan Eden wrote:
> Hi Jeremy,
>
> Jeremy Morris wrote on 14.08.2004:
>
>>I am quite new at using perl and mysql. I just installed
>>the DBI and DBD packages, and was required to download
>>the
>>header files to do so. Once all these things were
>>installed, I tried a simple script to see if it works.
>> Here is the code I tried:
>>
>>#!/usr/bin/perl -w
>>use strict;
>>use DBI; (I also tried use DBD::mysql, same effect)
>>
>>my $dsn = 'dbi:mysql:databasename:myhostname:3306';
>>my $user = 'myusername';
>>my $pswd = 'mypassword';
>>
>>my $dbh = DBI->connect($dsn,$user,$pswd) or die 'try
>>again\n';
>>
>>I get the follwing error message after running $> perl
>>filename.pl :
>>DBI
>>connect('databasename:myhostname:3306','myusername','...)
>>failed: Host 'myipaddress' is not allowed to connect to
>>this MySQL server at filename.pl line 9
>
> Did you set up the MySQL server yourself? Some ISPs
>offer MySQL databases where access is restricted to their
>own webservers. This is a good thing from a security
>viewpoint, but in that case you have to connect to the
>webserver via ssh and run your script directly from the
>remote server.
>
> HTH,
>
> Jan
> --
> Either this man is dead or my watch has stopped. -
>Groucho Marx
>
> --
> MySQL Perl Mailing List
>For list archives: http://lists.mysql.com/perl
> To unsubscribe:
> http://lists.mysql.com/perl?unsub=jeremy@decent1.com
>

Yes, I set up the server myself. I am working on my
machine at home, so the server is local. I think what is
wrong is that my Perl is set up with threading installed.
Do you know how to turn that off?

Jeremy

http://www.math.utah.edu/~c-msjd/

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 16.08.2004 16:56:40 von Jeremy Morris

On Sun, 15 Aug 2004 14:12:00 +0200
Jan Eden wrote:
> Hi Jeremy,
>
> Jeremy Morris wrote on 14.08.2004:
>
>>I am quite new at using perl and mysql. I just installed
>>the DBI and DBD packages, and was required to download
>>the
>>header files to do so. Once all these things were
>>installed, I tried a simple script to see if it works.
>> Here is the code I tried:
>>
>>#!/usr/bin/perl -w
>>use strict;
>>use DBI; (I also tried use DBD::mysql, same effect)
>>
>>my $dsn = 'dbi:mysql:databasename:myhostname:3306';
>>my $user = 'myusername';
>>my $pswd = 'mypassword';
>>
>>my $dbh = DBI->connect($dsn,$user,$pswd) or die 'try
>>again\n';
>>
>>I get the follwing error message after running $> perl
>>filename.pl :
>>DBI
>>connect('databasename:myhostname:3306','myusername','...)
>>failed: Host 'myipaddress' is not allowed to connect to
>>this MySQL server at filename.pl line 9
>
> Did you set up the MySQL server yourself? Some ISPs
>offer MySQL databases where access is restricted to their
>own webservers. This is a good thing from a security
>viewpoint, but in that case you have to connect to the
>webserver via ssh and run your script directly from the
>remote server.
>
> HTH,
>
> Jan
> --
> Either this man is dead or my watch has stopped. -
>Groucho Marx
>
> --
> MySQL Perl Mailing List
>For list archives: http://lists.mysql.com/perl
> To unsubscribe:
> http://lists.mysql.com/perl?unsub=jeremy@decent1.com
>

Yes, I set up the server myself. I am working on my
machine at home, so the server is local. I think what is
wrong is that my Perl is set up with threading installed.
Do you know how to turn that off?

Jeremy

http://www.math.utah.edu/~c-msjd/

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 16.08.2004 18:12:09 von Jeremy Rice

> I get the follwing error message after running $> perl
> filename.pl :
> DBI
> connect('databasename:myhostname:3306','myusername','...)
> failed: Host 'myipaddress' is not allowed to connect to
> this MySQL server at filename.pl line 9
>
> So I went into webmin to see what was happening there;
> whenever I try to look at something, I get the following
> message:
> HTTP/1.0 500 Perl execution failed Server: MiniServ/0.01
> Date: Sat, 14 Aug 2004 05:22:14 GMT Content-type:
> text/html Connection: close
> Error - Perl execution failed
>
> Can't use an undefined value as a HASH reference at
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/m ysql.pm
> line 113.
>
> Does anyone know what is going on?

I really sounds like you haven't set up your GRANT tables in MySQL.

Have you?

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 16.08.2004 18:12:09 von Jeremy Rice

> I get the follwing error message after running $> perl
> filename.pl :
> DBI
> connect('databasename:myhostname:3306','myusername','...)
> failed: Host 'myipaddress' is not allowed to connect to
> this MySQL server at filename.pl line 9
>
> So I went into webmin to see what was happening there;
> whenever I try to look at something, I get the following
> message:
> HTTP/1.0 500 Perl execution failed Server: MiniServ/0.01
> Date: Sat, 14 Aug 2004 05:22:14 GMT Content-type:
> text/html Connection: close
> Error - Perl execution failed
>
> Can't use an undefined value as a HASH reference at
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/m ysql.pm
> line 113.
>
> Does anyone know what is going on?

I really sounds like you haven't set up your GRANT tables in MySQL.

Have you?

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 16.08.2004 20:57:03 von Jan Eden

Jeremy Morris wrote on 16.08.2004:

>Yes, I set up the server myself. I am working on my=20
>machine at home, so the server is local. I think what is=20
>wrong is that my Perl is set up with threading installed.=20
> Do you know how to turn that off?
>
>Jeremy

See Jeremy Rice's comment. Did you GRANT the appropriate rights to myuserna=
me@localhost?

- Jan
--=20
There are 10 kinds of people: those who understand binary, and those who d=
on't

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: script not able to connect

am 16.08.2004 20:57:03 von Jan Eden

Jeremy Morris wrote on 16.08.2004:

>Yes, I set up the server myself. I am working on my=20
>machine at home, so the server is local. I think what is=20
>wrong is that my Perl is set up with threading installed.=20
> Do you know how to turn that off?
>
>Jeremy

See Jeremy Rice's comment. Did you GRANT the appropriate rights to myuserna=
me@localhost?

- Jan
--=20
There are 10 kinds of people: those who understand binary, and those who d=
on't

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org

Re: script not able to connect

am 16.08.2004 21:22:54 von Jeremy Morris

>
> See Jeremy Rice's comment. Did you GRANT the appropriate
>rights to myusername@localhost?
>
> - Jan
> --

After checking the permissions and reading more on the
internet, I realized that I did not require a password for
myself. Meaning I should have been leaving the password
variable blank. I felt pretty dumb after that worked.

Jeremy Morris

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: script not able to connect

am 16.08.2004 21:22:54 von Jeremy Morris

>
> See Jeremy Rice's comment. Did you GRANT the appropriate
>rights to myusername@localhost?
>
> - Jan
> --

After checking the permissions and reading more on the
internet, I realized that I did not require a password for
myself. Meaning I should have been leaving the password
variable blank. I felt pretty dumb after that worked.

Jeremy Morris

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org