Adding multiple foreign keys to single table
You have a syntax problem, try this :

Create Table If not exists CompanyRank
(
CID int, Year int, IndexYN int, SPRank int, FortuneRank int,
primary key (CID, Year), index (CID), Index(year),
foreign key (CID) references CompanyInfo (CID),
foreign key (Year) references TimePeriod (Year)
) engine = innodb;


the reference is "CompanyInfo (CID)", not "CompanyInfo.CID"