I understand your intention to exclude this traffic, but it should be automatically excluded if this database connection is local. Technically this means that all traffic between the following addresses is ignored:
IPv4:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
169.254.0.0 to 169.254.255.255
224.0.0.0 to 239.255.255.255
IPv6:
fe80::/10
fc00::/7
ffx2::/16
Perhaps you are using a different addressing scheme? Or try adding the range of 127.0.0.1 through 127.0.0.255 to be ignored under the Setup button.