"MySQL case" ERROR 1786 (HY000)

Source: Internet
Author: User

1.1.1. ERROR 1786 (HY000)

"Environment description"

msyql5.6.14

"Error Message"

Error encountered when executing CREATE TABLE ... select:

DB1 [Test] [23:01:58]> Create Tablelgmnr_bak select * from LGMNR;

ERROR 1786 (HY000): CREATE TABLE ... Selectis Forbidden when @ @GLOBAL. Enforce_gtid_consistency = 1

"Cause of error"

ERROR1786 is caused by the opening of the Enforce_gtid_consistency=true function, MySQL official explained that when the Enforce_gtid_consistency function is enabled, MySQL only allows to ensure that the transaction security, and SQL statements that can be logged are executed, like CREATE TABLE ... select and create temporarytable statements, and SQL statements or transactions that update both the transaction table and the non-transactional table are not allowed to execute.

DB1 [test] [23:28:28]> show variableslike ' enforce_gtid_consistency ';

+--------------------------+-------+

| variable_name | Value |

+--------------------------+-------+

| enforce_gtid_consistency | On |

+--------------------------+-------+

"Workaround"

Since the enforce_gtid_consistency parameter is read-only, the MySQL service must be restarted for the configuration to take effect.

Error when trying online dynamic modification:

DB1 [Test] [23:37:56]> set globalenforce_gtid_consistency=true;

ERROR 1238 (HY000): Variable ' enforce_gtid_consistency ' is a read only Variable

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.