mysql错误处理之ERROR 1786 (HY000)_MySQL
程序员文章站
2024-02-15 18:51:10
...
ERROR 1786 (HY000)
【环境描述】
msyql5.6.14
【报错信息】
执行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
【报错原因】
ERROR1786是由于开启了enforce_gtid_consistency=true功能导致的,MySQL官方解释说当启用enforce_gtid_consistency功能的时候,MySQL只允许能够保障事务安全,并且能够被日志记录的SQL语句被执行,像create table ... select 和 create temporarytable语句,以及同时更新事务表和非事务表的SQL语句或事务都不允许执行。
db1 [test] [23:28:28]> show variableslike 'ENFORCE_GTID_CONSISTENCY';+--------------------------+-------+| Variable_name | Value |+--------------------------+-------+| enforce_gtid_consistency | ON |+--------------------------+-------+
【解决方法】
由于enforce_gtid_consistency参数是只读的,所以必须重启MySQL服务才能是配置生效。
尝试在线动态修改时的报错:
db1 [test] [23:37:56]> set globalenforce_gtid_consistency=true;ERROR 1238 (HY000): Variable'enforce_gtid_consistency' is a read only variable
下一篇: PHP是怎么进行输入输出的_PHP教程
推荐阅读
-
mysql错误处理之ERROR 1786 (HY000)_MySQL
-
记MySQL的哈希加密问题导致的远程连接异常:”ERROR 2049 (HY000)
-
mysql出现ERROR 1819 (HY000)的解决方法
-
【MySQL案例】ERROR 1665 (HY000)_MySQL
-
mysql错误处理之ERROR 1665 (HY000)_MySQL
-
【MySQL案例】ERROR 1786 (HY000)_MySQL
-
ERROR 2002 (HY000): Can't connect to local MySQL ser
-
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)已解决
-
mysql ERROR 2002 (HY000): Can't connect to local_MySQL
-
IT忍者神龟之mysql远程连接:ERROR1130(HY000):Host'*.*