Reputation: 12829
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?
Upvotes: 0
Views: 415
Reputation: 2740
You need to follow the below-mentioned steps :
After this your query will be persisted
Upvotes: 0
Reputation: 12829
The rule_id field is mandatory.
{
rule_id=1
active = 1
match_digest = "^SHOW.*"
destination_hostgroup = 3
apply = 0
},
Upvotes: 0