Net::MySQL hangs



Strange problem. I can get the example program to work with MySQL but
I can't get it to work with my other table. In hpux where would i
find the error messages generated by this?

Here is the code

$ cat dnssel.pl
#!/usr/bin/perl

# a test of querying the dnstable on database dev

use strict;

use Net::MySQL;

my $mysql = Net::MySQL->new(
hostname => 'localhost',
database => 'dev',
user => 'dev',
password => 'passwrd',
);

# now setup query into database
print " before if \n";
$mysql->query(q{SELECT hostid FROM dns_table});

print "aftere if \n";
# Iterate over each result printing out what we got.
my $record_set = $mysql->create_record_iterator;
while (my $record = $record_set->each) {
printf "hostid column: %s \n",
$record->[0];
}
$mysql->close;

and yet this works fine

#!/usr/bin/perl

# a test of querying the dnstable on database dev

use strict;

use Net::MySQL;

my $mysql = Net::MySQL->new(
hostname => 'localhost',
database => 'dev',
user => 'dev',
password => 'passwrd',
);

# now setup query into database

# INSERT example
=item comment
$mysql->query(q{
INSERT INTO test (first, next) VALUES ('Hello', 'World')
});
printf "Affected row: %d\n", $mysql->get_affected_rows_length;
=cut
# SLECT example
$mysql->query(q{SELECT * FROM test});
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;

mysql> desc dnstable;

+--------------------+-----------------+--------+-------
+-------------------------------------+-------+

| Field | Type | Null | Key |
Default | Extra |

+-------------------+-----------------+--------+-------
+-------------------------------------+-------+

| hostid | varchar(4) | NO | PRI
| | |

| hostname | varchar(40) | NO | |
EMPTY | |

| current_ip | varchar(16) | NO | |
0.0.0.0 | |

| last_ip | varchar(16) | NO | |
0.0.0.0 | |

| num_change | tinyint(3) | NO |
| | |

| date_time | timestamp | NO | | CURRENT_TIMESTAMP
| |

+-------------------+-----------------+--------+-------
+-------------------------------------+-------+

6 rows in set (0.00 sec)

Oh yes there is one entry in this table.

This is on a HPUX 11i system.

Thanks

Mike

.



Relevant Pages

  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • ANN: Database Designer for MySQL version 1.6 is released
    ... The new version 1.6 of MicroOLAP Database Designer for MySQL has been ... The secure shell (SSH) tunneling is now implemented in Database ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: PICK OPENDB provides connection in shopping cart startup
    ... we MIS folks are required to take on tasks that we don't ... developer, nor the database. ... Why do you need MySQL?. ... in size that KTP experienced, evolving to the current 90,000+ sq. ...
    (comp.databases.pick)
  • Re: Java and MySql program example ?
    ... > I am trying to learn Java and need an example program with MySql ... > MySql database. ... Database connection established ...
    (comp.lang.java.programmer)
  • Re: Creating Mysql DB with PHP
    ... >> userID and password for that MySQL server. ... > I am only going by what I have to do when setting up a new database. ...
    (alt.php)