Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

org.apache.ambari.server.AmbariException: Cannot add foreign key constraint

Solved Go to solution

Re: org.apache.ambari.server.AmbariException: Cannot add foreign key constraint

Expert Contributor

This is known issue for MYSQL DBs and we need to convert all the tables to use InnoDB engine.

You can use the below SQL to generate the commands to alter the tables to InnoDB engine.

SELECT concat('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')

FROM Information_schema.TABLES

WHERE TABLE_SCHEMA = 'ambaridb' AND ENGINE = 'MyISAM' AND TABLE_TYPE='BASE TABLE';

Once we get the output , remove the ' | ' and run the alter commands.

Once we run alter commands, commit and exit mysql.

and than run ambari-server upgrade.

Re: org.apache.ambari.server.AmbariException: Cannot add foreign key constraint

Mentor

@Raja Sekhar Chintalapati did that solve your issue?

Don't have an account?
Coming from Hortonworks? Activate your account here