Server System Variables System Variable sql_quote_show_create Scope Global, Session Dynamic Yes SET_VAR  Hint Applies No Type Boolean Default Value ON Command-Line Format --sql-require-primary-key[={OFF|ON}] Introduced 8.0.13 System Variable sql_require_primary_key Scope Global, Session Dynamic Yes SET_VAR  Hint Applies Yes Type Boolean Default Value OFF • sql_quote_show_create • sql_require_primary_key If enabled (the default), the server quotes identifiers for  SHOW CREATE TABLE  and  SHOW CREATE DATABASE  statements. If disabled, quoting is disabled. This option is enabled by default so that replication works for identifiers that require quoting. See Section 13.7.7.10, “SHOW CREATE TABLE Statement” , and Section 13.7.7.6, “SHOW CREATE DATABASE Statement” . Whether statements that create new tables or alter the structure of existing tables enforce the requirement that tables have a primary key. Setting the session value of this system variable is a restricted operation. The session user must have privileges sufficient to set restricted session variables. See Section 5.1.9.1, “System Variable Privileges” . Enabling this variable helps avoid performance problems in row-based replication that can occur when tables have no primary key. Suppose that a table has no primary key and an update or delete modifies multiple rows. On the replication source server, this operation can be performed using a single table scan but, when replicated using row-based replication, results in a table scan for each row to be modified on the replica. With a primary key, these table scans do not occur. sql_require_primary_key  applies to both base tables and  TEMPORARY  tables, and changes to its value are replicated to replica servers. As of MySQL 8.0.18, it applies only to storage engines that can participate in replication. When enabled,  sql_require_primary_key  has these effects: •Attempts to create a new table with no primary key fail with an error. This includes  CREATE TABLE ... LIKE . It also includes  CREATE TABLE ... SELECT , unless the  CREATE TABLE  part includes a primary key definition. 888