Hi,
I am creating tables with foreign keys and the Innodb function. The tables get created fine, but when I do a show table status; all of them are still MyISAM.
The database schema is as follows:
CREATE TABLE booking (
Booking_ID int(11) NOT NULL auto_increment,
Customer_ID int(11) NOT NULL default '0',
Vehicle_Group_ID int(11) NOT NULL default '0',
Pick_Up_Location int(11) NOT NULL default '0',
Pick_Up_Date date NOT NULL default '0000-00-00',
Pick_Up_Time time NOT NULL default '00:00:00',
Pick_Up_Mileage int(6) default NULL,
Drop_Off_Location int(11) NOT NULL default '0',
Drop_Off_Date date NOT NULL default '0000-00-00',
Drop_Off_Time time NOT NULL default '00:00:00',
Drop_Off_Mileage int(6) default NULL,
Booking_Date date default NULL,
Credit_Card_Number int(16) NOT NULL default '0',
Expiry_Date varchar(5) NOT NULL default '',
Total_Amount float default NULL,
Vehicle_Registration varchar(7) NOT NULL default '',
PRIMARY KEY (Booking_ID),
KEY Customer_ID (Customer_ID),
KEY Vehicle_Group_ID (Vehicle_Group_ID),
KEY Pick_Up_Location (Pick_Up_Location),
KEY Drop_Off_Location (Drop_Off_Location),
KEY Vehicle_Registration (Vehicle_Registration),
FOREIGN KEY (`Customer_ID`) REFERENCES `customer` (`Customer_ID`),
FOREIGN KEY (`Vehicle_Group_ID`) REFERENCES `vehicle_group` (`Vehicle_Group_ID`),
FOREIGN KEY (`Vehicle_Registration`) REFERENCES `vehicle` (`Vehicle_Registration`),
FOREIGN KEY (`Pick_Up_Location`) REFERENCES `location` (`Location_ID`),
FOREIGN KEY (`Drop_Off_Location`) REFERENCES `location` (`Location_ID`)
) TYPE=InnoDB;
CREATE TABLE customer (
Customer_ID int(11) NOT NULL auto_increment,
Customer_Category_ID int(11) NOT NULL default '0',
Customer_Title varchar(5) default NULL,
Customer_Fname varchar(10) NOT NULL default '',
Customer_Lname varchar(12) NOT NULL default '',
Customer_Address varchar(80) default NULL,
Customer_Town varchar(20) default NULL,
Customer_County varchar(20) default NULL,
Customer_Postcode varchar(10) default NULL,
Customer_Telephone_Number varchar(15) default NULL,
Customer_Email varchar(35) NOT NULL default '',
Customer_DOB date NOT NULL default '0000-00-00',
Customer_Driving_License varchar(15) NOT NULL default '',
PRIMARY KEY (Customer_ID),
KEY Customer_Category_ID (Customer_Category_ID),
FOREIGN KEY (`Customer_Category_ID`) REFERENCES `customer_category` (`Customer_Category_ID`)
) TYPE=InnoDB;
CREATE TABLE location (
Location_ID int(11) NOT NULL auto_increment,
Location_Name varchar(35) NOT NULL default '',
Location_Address varchar(80) default NULL,
Location_Town varchar(20) default NULL,
Location_County varchar(25) default NULL,
Location_Postcode varchar(10) default NULL,
Location_Telephone_Number varchar(15) default NULL,
Location_Email varchar(35) NOT NULL default '',
PRIMARY KEY (Location_ID)
) TYPE=InnoDB;
etc, all the other tables have the TYPE=InnoDB statement.
I have also read that I can change the default MyISAM to InnoDB by writing a line in the my.cnf file. A problem is that I cannot find a My.cnf on my machine!
I have these tables created fine on one machine, and the InnoDB works fine, but I need them on another, and this is where the problem is.
Please can someone help!
Thanks
I am creating tables with foreign keys and the Innodb function. The tables get created fine, but when I do a show table status; all of them are still MyISAM.
The database schema is as follows:
CREATE TABLE booking (
Booking_ID int(11) NOT NULL auto_increment,
Customer_ID int(11) NOT NULL default '0',
Vehicle_Group_ID int(11) NOT NULL default '0',
Pick_Up_Location int(11) NOT NULL default '0',
Pick_Up_Date date NOT NULL default '0000-00-00',
Pick_Up_Time time NOT NULL default '00:00:00',
Pick_Up_Mileage int(6) default NULL,
Drop_Off_Location int(11) NOT NULL default '0',
Drop_Off_Date date NOT NULL default '0000-00-00',
Drop_Off_Time time NOT NULL default '00:00:00',
Drop_Off_Mileage int(6) default NULL,
Booking_Date date default NULL,
Credit_Card_Number int(16) NOT NULL default '0',
Expiry_Date varchar(5) NOT NULL default '',
Total_Amount float default NULL,
Vehicle_Registration varchar(7) NOT NULL default '',
PRIMARY KEY (Booking_ID),
KEY Customer_ID (Customer_ID),
KEY Vehicle_Group_ID (Vehicle_Group_ID),
KEY Pick_Up_Location (Pick_Up_Location),
KEY Drop_Off_Location (Drop_Off_Location),
KEY Vehicle_Registration (Vehicle_Registration),
FOREIGN KEY (`Customer_ID`) REFERENCES `customer` (`Customer_ID`),
FOREIGN KEY (`Vehicle_Group_ID`) REFERENCES `vehicle_group` (`Vehicle_Group_ID`),
FOREIGN KEY (`Vehicle_Registration`) REFERENCES `vehicle` (`Vehicle_Registration`),
FOREIGN KEY (`Pick_Up_Location`) REFERENCES `location` (`Location_ID`),
FOREIGN KEY (`Drop_Off_Location`) REFERENCES `location` (`Location_ID`)
) TYPE=InnoDB;
CREATE TABLE customer (
Customer_ID int(11) NOT NULL auto_increment,
Customer_Category_ID int(11) NOT NULL default '0',
Customer_Title varchar(5) default NULL,
Customer_Fname varchar(10) NOT NULL default '',
Customer_Lname varchar(12) NOT NULL default '',
Customer_Address varchar(80) default NULL,
Customer_Town varchar(20) default NULL,
Customer_County varchar(20) default NULL,
Customer_Postcode varchar(10) default NULL,
Customer_Telephone_Number varchar(15) default NULL,
Customer_Email varchar(35) NOT NULL default '',
Customer_DOB date NOT NULL default '0000-00-00',
Customer_Driving_License varchar(15) NOT NULL default '',
PRIMARY KEY (Customer_ID),
KEY Customer_Category_ID (Customer_Category_ID),
FOREIGN KEY (`Customer_Category_ID`) REFERENCES `customer_category` (`Customer_Category_ID`)
) TYPE=InnoDB;
CREATE TABLE location (
Location_ID int(11) NOT NULL auto_increment,
Location_Name varchar(35) NOT NULL default '',
Location_Address varchar(80) default NULL,
Location_Town varchar(20) default NULL,
Location_County varchar(25) default NULL,
Location_Postcode varchar(10) default NULL,
Location_Telephone_Number varchar(15) default NULL,
Location_Email varchar(35) NOT NULL default '',
PRIMARY KEY (Location_ID)
) TYPE=InnoDB;
etc, all the other tables have the TYPE=InnoDB statement.
I have also read that I can change the default MyISAM to InnoDB by writing a line in the my.cnf file. A problem is that I cannot find a My.cnf on my machine!
I have these tables created fine on one machine, and the InnoDB works fine, but I need them on another, and this is where the problem is.
Please can someone help!
Thanks