Client 192.168.1.133 MaxScale 192.168.1.154 : 4008 MariaDB Server 192.168.1.218 : 10614 hostfile on MariaDB/MaxScale: 192.168.1.133 da1.example.com MariaDB [(none)]> select user,host from mysql.user where user like 'test0%'; +--------+-----------------+ | User | Host | +--------+-----------------+ | test03 | da1.% | BAD | test04 | da_.example.com | OK | test05 | da% | BAD | test06 | da1% | BAD | test07 | da%example.com | OK +--------+-----------------+ They all login OK directly to MariaDB. maxctrl show dbusers ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ │ test03 │ da1.% │ mysql_native_password │ false │ false │ false │ false │ │ ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ │ test04 │ da_.example.com │ mysql_native_password │ false │ false │ false │ false │ │ ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ │ test05 │ da% │ mysql_native_password │ false │ false │ false │ false │ │ ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ │ test06 │ da1% │ mysql_native_password │ false │ false │ false │ false │ │ ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ │ test07 │ da%example.com │ mysql_native_password │ false │ false │ false │ false │ │ ├─────────────┼─────────────────┼───────────────────────┼───────┼───────┼────────┼───────┼──────┤ [root@localhost claudio]# mysql -u test03 -p123 -h192.168.1.218 -P 10614 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+----------------+ | user() | current_user() | +------------------------+----------------+ | test03@da1.example.com | test03@da1.% | +------------------------+----------------+ 1 row in set (0.000 sec) [root@localhost claudio]# mysql -u test04 -p123 -h192.168.1.218 -P 10614 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+------------------------+ | user() | current_user() | +------------------------+------------------------+ | test04@da1.example.com | test04@da_.example.com | +------------------------+------------------------+ 1 row in set (0.000 sec) [root@localhost claudio]# mysql -u test05 -p123 -h192.168.1.218 -P 10614 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+----------------+ | user() | current_user() | +------------------------+----------------+ | test05@da1.example.com | test05@da% | +------------------------+----------------+ 1 row in set (0.001 sec) [root@localhost claudio]# mysql -u test06 -p123 -h192.168.1.218 -P10614 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+----------------+ | user() | current_user() | +------------------------+----------------+ | test06@da1.example.com | test06@da1% | +------------------------+----------------+ 1 row in set (0.001 sec) [root@localhost claudio]# mysql -u test07 -p123 -h192.168.1.218 -P10614 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+-----------------------+ | user() | current_user() | +------------------------+-----------------------+ | test07@da1.example.com | test07@da%example.com | +------------------------+-----------------------+ Now via MaxScale: [root@localhost claudio]# mysql -u test03 -p123 -h192.168.1.154 -P4008 ERROR 1045 (28000): Access denied for user 'test03'@'192.168.1.133' (using password: YES) [root@localhost claudio]# mysql -u test04 -p123 -h192.168.1.154 -P4008 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+------------------------+ | user() | current_user() | +------------------------+------------------------+ | test04@da1.example.com | test04@da_.example.com | +------------------------+------------------------+ 1 row in set (0.003 sec) [root@localhost claudio]# mysql -u test05 -p123 -h192.168.1.154 -P4008 ERROR 1045 (28000): Access denied for user 'test05'@'192.168.1.133' (using password: YES) [root@localhost claudio]# mysql -u test06 -p123 -h192.168.1.154 -P4008 ERROR 1045 (28000): Access denied for user 'test06'@'192.168.1.133' (using password: YES [root@localhost claudio]# mysql -u test07 -p123 -h192.168.1.154 -P4008 Welcome to the MariaDB monitor. Commands end with ; or \g. MariaDB [(none)]> select user(),current_user(); +------------------------+-----------------------+ | user() | current_user() | +------------------------+-----------------------+ | test07@da1.example.com | test07@da%example.com | +------------------------+-----------------------+ 1 row in set (0.004 sec)