Problems with Net::MySQL on OS X Server



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

.



Relevant Pages

  • Resulting Makefile wont make during install of DBD-ODBC
    ... I've been trying to install DBD-ODBC on a Solaris 2.8 machine and have hit a ... After running perl Makefile.pl, I tried running make. ... I have the 'make' utility that came with Solaris and the GNU 'make' utility. ...
    (perl.dbi.users)
  • Re: Problems with Net::MySQL...
    ... MySQL 4.0.18, the OS X box is running perl 5.6.2 and MySQL 4.0.18. ... connect to the database named '!', ...
    (comp.lang.perl.misc)
  • Re: Problems with Net::MySQL on OS X Server
    ... The Solaris box was running perl 5.6.1 and MySQL 4.0.18, ... the Solaris box will connect successfully to the ... Mac OS 10.4 comes with Perl 5.8.6. ...
    (comp.lang.perl.modules)
  • Re: Benchmarking MySQL on Solaris 10
    ... I'm giving a look at Solaris 10 cause I'm ... and I had no problem with MySQL 4.1.18 up and running. ... trying to install DBI perl module via CPAN (Perl 5.4.8, ... Your tweaking probably wasn't a good idea. ...
    (comp.unix.solaris)
  • Problems with Net::MySQL...
    ... I'm trying to port a web-based application from a Solaris 2.6 box to ... MySQL 4.0.18, the OS X box is running perl 5.6.2 and MySQL 4.0.18. ...
    (comp.lang.perl.misc)