in reply to Re: MySQL doesn't work with perl
in thread MySQL doesn't work with perl
The doc for Net::MySQL reads:
This module implements network protocol between server and client of MySQL, thus you don't need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. How nifty!But if DBI is available, because it is more "usual", the principle of least surprise says to use that.
I can't comment on why your Net::MySQL code doesn't work as expected. It certainly seems okay. You might try logging in the mysql client and trying
to see what the server is doing when it hangs. Also, I'd add a bunch of or die $dbh->errstr() to the $dbh->prepare and $sth->execute statements, just to get a feel for what could be going wrong.mysql> show full processlist; +----+-------+----------------+------+---------+------+-------+------- +----------------+ | Id | User | Host | db | Command | Time | State | Info + | +----+-------+----------------+------+---------+------+-------+------- +----------------+ | 1 | woody | localhost:2244 | to9 | Query | 0 | NULL | show fu +ll processlist | +----+-------+----------------+------+---------+------+-------+------- +----------------+ 1 row in set (0.10 sec)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: MySQL doesn't work with perl
by srfrogster (Initiate) on Jan 10, 2008 at 16:18 UTC |