Translations:Manual:Security/46/en

Setting $addr in your $ini (under section $mysqld) will cause MySQL/MariaDB to only listen on the loopback interface.