0

My proxysql.cnf contains:

# ...
mysql_query_rules:
(
    {
        active = 1
        match_digest = "^SHOW.*"
        destination_hostgroup = 3
        apply = 0
    },
    {
        active = 1
        match_digest = "^SELECT.*"
        destination_hostgroup = 3
        apply = 0
    },
    {
        active = 1
        match_digest = "^SELECT.* FOR UPDATE"
        destination_hostgroup = 2
        apply = 1
    },
)

# ...

But when proxysql starts, the mysql_query_rules defintion is not loaded.

select * from mysql_query_rules;
Empty set (0.001 sec)

How to make proxysql loads the mysql_query_rules definition from the proxysql.cnf file at startup?

redochka
  • 12,345
  • 14
  • 66
  • 79

1 Answers1

0

The rule_id field is mandatory.

{
   rule_id=1
   active = 1
   match_digest = "^SHOW.*"
   destination_hostgroup = 3
   apply = 0
},
redochka
  • 12,345
  • 14
  • 66
  • 79