MySQL 5.5 is stricter in its syntax and requires the referenced columns as well. Also, the column types must match exactly.
org.nuxeo.ecm.core.storage.StorageException: java.sql.SQLException: Error executing: ALTER TABLE locks ADD CONSTRAINT locks_id_hierarchy_fk FOREIGN KEY (id) REFERENCES hierarchy ON DELETE CASCADE; : Can't create table 'bandersnatch.#sql-d36_14321' (errno: 150) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.createDatabase(JDBCMapper.java:152) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCBackend.newMapper(JDBCBackend.java:160) at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.getConnection(RepositoryImpl.java:389) at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.getConnection(RepositoryImpl.java:359) at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.getConnection(RepositoryImpl.java:54) at org.nuxeo.ecm.core.storage.sql.TestSQLBackend.doTestLocksUpgrade(TestSQLBackend.java:3020) at org.nuxeo.ecm.core.storage.sql.TestSQLBackend.testLocksUpgrade(TestSQLBackend.java:3013)