PDA

View Full Version : table not found??


jason.hall
01-15-2004, 11:15 PM
This problem has been baffling me for days. I have a Perl script that accesses two MySQL tables - or at least it DID, until I moved my site from my home computer to HostRocket. Now all I get is table not found - even though I'm looking right at it in PHPMyAdmin from the Control Panel!

So, I tried it from scratch - create a test DB named test (which HostRocket prefixes with my username), put in a table with a few rows named TBL_POD, created a sample user called usr, and assigned usr permission to test. Then I wrote and ran this simple test script (partially copied from my original script that didn't work):



------------------
#!/usr/bin/perl -w

use DBI;
use strict;

my $dbh = DBI->connect("DBI:mysql:<username>_test:localhost","<username>_usr","<password>");
my $sth = $dbh -> prepare("SELECT * FROM TBL_POD");
$sth -> execute();
my $row = $sth -> fetchrow_hashref();

$sth->finish();
$dbh->disconnect;
exit;
------------------

I even copied-and-pasted the connect string from the MySQL Manager screen. But sure enough I get:
DBD::mysql::st execute failed: Table '<username>_test.TBL_POD' doesn't exist...'

Any ideas?
Thanks!!

jason.hall
01-27-2004, 04:35 PM
I played around with it for about 10 more seconds and realized it was a capitalization error. The reason the script worked fine at home is because I'm using Mac OS X, which isn't case sensitive for such things as MySQL tables names. HR/Linux is. Ugh....