Import existing database.

ERROR 3750 (HY000) at line 31: Unable to create or change a table without a primary key, when the system variable ‘sql_require_primary_key’ is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I encountered this issue as well.

Site Moderator
Site Moderator badge
March 15, 2022

Hi @SleepingDarkBlueScubaDiver,

I can see you are using DigitalOcean Managed MySQL Database. This requires you to have primary keys set on each table. What I’ll recommend is to add primary keys to your tables and then try again to import it.