Today while configuring mysql database for my Alfresco, I started getting these type of errors
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate key name ......
This error was coming when it was running this script
Then I realized that mysql on my macine was not using INNODB engine by default. I dropped the database and created again using innodb engine and it worked