Teflon Ted
Teflon Ted

Reputation: 8846

MySQL says table is there, then says it's not

check the database-generating sql (looks fine):

CREATE TABLE `HourOfDay` (
  `id` int(11) NOT NULL,
  `hourString` varchar(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

check the file system (it's there):

# ls -al Mycomp_test | grep -i hour
-rw-rw----    1 _mysql  wheel      0 Mar  1 08:13 HourOfDay.MYD
-rw-rw----    1 _mysql  wheel   1024 Mar  1 08:13 HourOfDay.MYI
-rw-rw----    1 _mysql  wheel   8598 Mar  1 08:13 HourOfDay.frm

check the database (looks good):

»mysql -u root Mycomp_test -e 'show tables' | grep -i hour
HourOfDay

check the database table (oops wtf!?):

»mysql -u root Mycomp_test -e 'show create table HourOfDay'
ERROR 1146 (42S02) at line 1: Table 'mycomp_test.hourofday' doesn't exist

UPDATE: More info

Upvotes: 2

Views: 314

Answers (2)

Teflon Ted
Teflon Ted

Reputation: 8846

8.2.2. Identifier Case Sensitivity

»cat /etc/my.cnf 
[mysqld]
lower_case_table_names=2

Upvotes: 1

MindStalker
MindStalker

Reputation: 14864

"Table 'mycomp_test.hourofday' doesn't exist" is suspicious, as it should be HourOFDay on a unix/linux system.

Upvotes: 1

Related Questions