need help regarding the issue, All of the sudden our production environment we are getting issue during upgrade command

SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.', query was: ALTER TABLE `widget_instance_page_layout` DEFAULT CHARSET='utf8', DEFAULT COLLATE='utf8_general_ci'

i tried to fix using this https://magento.stackexchange.com/a/352307/78648 but i am getting issue in lot of tables

i cant reproduce the issue on any other enviorment

1 Answer 1


This looks like a Mysql issue rather than Magento. Try the following command:

mysql> SET sql_generate_invisible_primary_key=OFF;

You can check the solution from here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.