# Route all traffic to a different host group

**URL:** https://forums.percona.com/t/route-all-traffic-to-a-different-host-group/35281
**Category:** ProxySQL
**Created:** [November 26, 2024, 4:06pm UTC](https://forums.percona.com/t/route-all-traffic-to-a-different-host-group/35281 "2024-11-26T16:06:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![user-201124](https://avatars.discourse-cdn.com/v4/letter/u/e9c0ed/32.png) [@user-201124](https://forums.percona.com/u/user-201124)
#### Post date: [November 26, 2024, 4:06pm UTC](https://forums.percona.com/t/route-all-traffic-to-a-different-host-group/35281/1 "2024-11-26T16:06:24Z")

</div>

I’ve a two host groups, 10 running MySQL57 and 20 running MySQ8. We mirror all traffic from 5.7 to 8.

By default the routing is when we add users we set default host\_group to 10.

We then have a rule to mirror the traffic:

```auto
select rule_id, active, destination_hostgroup, mirror_hostgroup, apply from runtime_mysql_query_rules;
+---------+--------+-----------------------+------------------+-------+
| rule_id | active | destination_hostgroup | mirror_hostgroup | apply |
+---------+--------+-----------------------+------------------+-------+
| 1 | 1 | 10 | 20 | 1 |
+---------+--------+-----------------------+------------------+-------+
1 row in set (0.00 sec)

ProxySQL Admin>

```

What is the easiest way to instead route all traffic to MySQL8 cluster, hostgroup 20?

Is there a way to do it using mysql\_query\_rules table or should we just update the default hostgroup in the mysql\_users table?

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [November 26, 2024, 5:15pm UTC](https://forums.percona.com/t/route-all-traffic-to-a-different-host-group/35281/2 "2024-11-26T17:15:40Z")

</div>

> [@user-201124](#):
>
> should we just update the default hostgroup in the mysql\_users table?

Yes, that is the easiest way.
