Click here to get back home

Problems with Net::MySQL on OS X Server

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Problems with Net::MySQL on OS X Server chriswaltham 11-10-2006
Posted by chriswaltham on November 10, 2006, 7:01 pm
Please log in for more thread options


I'm trying to port a web-based application from a Solaris 2.6 box to
Mac OS X Server 10.4.8.

The Solaris box was running perl 5.6.1 and MySQL 4.0.18, the OS X box
is running perl 5.6.2 and MySQL 4.0.18. Both are running Net::MySQL
0.009. The trouble is, the Solaris box will connect successfully to the
MySQL DB but the OS X box will not.

This is the code:

#!/usr/bin/perl -w
use Net::MySQL;

my $mysql = Net::MySQL->new(
database => 'mysql',
user => 'root',
password => '*'
);

# SLECT example
$mysql->query(q{SELECT * FROM user});
my $record_set = $mysql->create_record_iterator;
while (my $record = $record_set->each) {
printf "First column: %s Next column: %s\n",
$record->[0], $record->[1];
}
$mysql->close;

And this is the error it yields:

[root@csc-web2 admin]# perl test.pl
Access denied for user: '@localhost' to database '!' at test.pl line 5

I am pretty new to perl, so I'm not quite sure how to debug this. The
username and password are definitely correct, but the most troubling
thing is that the error message says that the perl file is trying to
connect to the database named '!', not the database named 'mysql'.
Anyone have any ideas on how I can debug this?

Thanks,


Chris


Posted by harryfmudd [AT] comcast [DOT] on November 11, 2006, 10:22 pm
Please log in for more thread options


chriswaltham@gmail.com wrote:

> I'm trying to port a web-based application from a Solaris 2.6 box to
> Mac OS X Server 10.4.8.
>
> The Solaris box was running perl 5.6.1 and MySQL 4.0.18, the OS X box
> is running perl 5.6.2 and MySQL 4.0.18. Both are running Net::MySQL
> 0.009. The trouble is, the Solaris box will connect successfully to the
> MySQL DB but the OS X box will not.
>

Huh? Mac OS 10.4 comes with Perl 5.8.6. Somebody downgraded it?

Tom Wyant

Posted by chriswaltham on November 12, 2006, 2:35 pm
Please log in for more thread options


harryfmudd [AT] comcast [DOT] net wrote:
> chriswaltham@gmail.com wrote:
>
> > I'm trying to port a web-based application from a Solaris 2.6 box to
> > Mac OS X Server 10.4.8.
> >
> > The Solaris box was running perl 5.6.1 and MySQL 4.0.18, the OS X box
> > is running perl 5.6.2 and MySQL 4.0.18. Both are running Net::MySQL
> > 0.009. The trouble is, the Solaris box will connect successfully to the
> > MySQL DB but the OS X box will not.
> >
>
> Huh? Mac OS 10.4 comes with Perl 5.8.6. Somebody downgraded it?
>
> Tom Wyant

I downgraded it... well, actually, I just compiled it and installed it
in /usr/local/perl/. Because I'm not the author of the original web
app, I want to try and replicate its environment as much as possible
when I'm porting it.

After I actually get it working, I'll try using perl-5.8.6 against it.
In the meantime, though, I am getting nowhere :-\ FWIW, I've installed
Net::MySQL under 5.8.6 and still haven't had any success.


Chris


Similar ThreadsPosted
Problems installing DBD::mysql on Solaris 10 November 2, 2005, 8:43 am
[RESOLVED] DBD::mysql unresolved symbol _intel_fast_memcpy & mysql-standard-5.0.22-linux-i686-icc-glibc23 August 29, 2006, 6:33 pm
MySQL 5.0 and Perl DBD-MySQL December 3, 2005, 1:10 am
Embedded mysql with DBD::mysql July 30, 2008, 10:15 am
DBD:mysql doesn't read mysql option file /etc/my.cnf file January 27, 2005, 11:19 pm
Net::Server -> tftpd ? May 28, 2006, 6:21 am
TACACS+ with Cisco ACS server 3.2 August 6, 2004, 10:26 am
Start server for test ? May 16, 2005, 12:52 pm
Serialization by SOAP server July 7, 2006, 8:37 am
Net::Server - how to hook post_accept August 20, 2006, 6:27 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap