Hello all,
I have a database called 'alarms' and it has only MyISAM tables. I decided to add 2 more tables to the schema, called routers and router_details, which would be InnoDB tables, as I want a foreign key constraint between them.
I created the tables using following command:
After above, I see the tables names in 'show tables' and also the .frm file in the data dir. But when I execute a simple select:
from within a php script, it gives me the error - 'Table alarms.routers doesn't exist'. What's going on?
Any help would be greatly appreciated.
Thanks,
Trupti
I have a database called 'alarms' and it has only MyISAM tables. I decided to add 2 more tables to the schema, called routers and router_details, which would be InnoDB tables, as I want a foreign key constraint between them.
I created the tables using following command:
CREATE TABLE routers (absid int(11) NOT NULL auto_increment, hostname varchar(75) NOT NULL, community varchar(30) NOT NULL, PRIMARY KEY (absid)) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='List of routers and their SNMP community string'; CREATE TABLE router_details (absid int(11) NOT NULL auto_increment, PTR_router int(11) NOT NULL, interface_name varchar(15) NOT NULL, type enum('v4','v6') NOT NULL, ip_address varchar(39) NOT NULL, mask varchar(42) NOT NULL, ip_part1 bigint(20) unsigned NOT NULL COMMENT 'v4: number representation of full IPv4 address, v6: number representation of first half of IPv6 address', ip_part2 bigint(20) unsigned default NULL COMMENT 'v6 only: number representation of second half of IPv6 address', mask_part1 bigint(20) unsigned NOT NULL COMMENT 'v4: number representation of full IPv4 mask, v6: number representation of first half of IPv6 mask', mask_part2 bigint(20) unsigned default NULL COMMENT 'v6 only: number representation of second half of IPv6 mask', date_created date NOT NULL, date_removed date default NULL, PRIMARY KEY (absid, PTR_router, interface_name, type, ip_address), KEY details_of_router (PTR_router), CONSTRAINT details_of_router FOREIGN KEY (PTR_router) REFERENCES routers (absid) ON DELETE CASCADE) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='Interface, IP address and mask details on a router';
After above, I see the tables names in 'show tables' and also the .frm file in the data dir. But when I execute a simple select:
SELECT * FROM routers WHERE hostname = 'something';
from within a php script, it gives me the error - 'Table alarms.routers doesn't exist'. What's going on?
Any help would be greatly appreciated.
Thanks,
Trupti