Lee Soo Khoon wrote:
> Hi there!
> I have a the following lock error messsage which I don't understand what
> does it mean :
> DBD::mysql::st execute failed: Table 'User' was not locked with LOCK
> TABLES at DB_Acct.pm line 2419.
> can't execute the query: DBI::st=HASH(0x8160ac8)->errstr
> It breaks at the following code (which has been working fine) :
> $sql = "SELECT user_password, user_id FROM User
> WHERE user_name = '$user_name' ";
> $sql .= ($cookie eq "") ? "" : "AND cookie = '$cookie'";
> $sth = $dbh->prepare($sql)
> or die "Can't prepare $sql: $dbh->errstr\n";
> $rv = $sth->execute
> or die "can't execute the query: $sth->errstr\n";
> Any advice is greatly appreciated.
Not exactly sure, but the first thing I would check is if somebody else
has put a write lock on the table. Worst comes to worse, see if
restarting mysqld will help.