The query can‘t be routed to all backend servers because it includes SELECT and SQL variable modific

Posted 雅冰石

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The query can‘t be routed to all backend servers because it includes SELECT and SQL variable modific相关的知识,希望对你有一定的参考价值。

一 问题描述

同事反馈,通过maxscale执行sql的时候,报错。

sql内容:

SELECT 
  *,
  @rownum := @rownum + 1 AS r 
FROM
  (SELECT 
    '0dca79c35b' AS id 
  FROM
    DUAL) T

报错:

SQL Error (1064): Routing query to backend failed. See the error log for further detail

maxscale日志报错:

2021-07-12 15:39:05   warning: (244392) The query can't be routed to all backend servers because it includes SELECT and SQL variable modifications which is not supported. Set use_sql_variables_in=master or split the query to two, where SQL variable modifications are done in the first and the SELECT in the second one.


二 解决办法

修改maxscale配置文件,在读写分离服务配置下面,添加一行配置:

use_sql_variables_in=master

示例:

 #重启maxscale

systemctl restart maxscale

以上是关于The query can‘t be routed to all backend servers because it includes SELECT and SQL variable modific的主要内容,如果未能解决你的问题,请参考以下文章

The authenticity of host ‘172.16.132.189 (172.16.132.189)‘ can‘t be established.

ssh连接时提示THE AUTHENTICITY OF HOST XX CAN’T BE ESTABLISHED

IDA远程调试出现"The file can't be loaded by the debugger plugin."云云

The authenticity of host 192.168.0.xxx can't be established

gm图片处理器:The gm/convert binaries can't be found

ssh登录 The authenticity of host 192.168.0.xxx can't be established. 的问题