I recently created a database server in Digital Ocean, and it only supports MySQL 8. When I try to import a database of my Laravel project it reports this error:
Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set.
So I tried to change the sql_require_primary_key to OFF in mySQL server by running the command,
set sql_require_primary_key = off;
And it changed successfully, but after that it automatically returned to the previous setting.
In Laravel, some primary keys are set after creating the table, so it showing error while migrating. It's my live project so that I can not modify the migrations I already created.
Anyone knows how to change the sql_require_primary_key permanently on MySQL 8?