[MySQL Case] ERROR 1786 (HY000)

Source: Internet
Author: User

1.1.1. ERROR 1786 (HY000)

[Environment description]

Msyql5.6.14

[Error message]

An error occurred while 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

[Error cause]

ERROR1786 is because enforce_gtid_consistency = true is enabled. MySQL officially explains that when enforce_gtid_consistency is enabled, MySQL only allows transaction security, SQL statements that can be logged are executed, such as create table... select and create temporarytable statements, and SQL statements or transactions that update both the transaction table and non-transaction table are not allowed to be executed.

 

Db1 [test] [23:28:28]> show variableslike 'enforce _ GTID_CONSISTENCY ';

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

| Variable_name | Value |

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

| Enforce_gtid_consistency | ON |

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

[Solution]

Since the enforce_gtid_consistency parameter is read-only, you must restart the MySQL service to make the configuration take effect.

An error occurs when dynamic online modification is attempted:

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.