PortGate

Blueprints · Docker & Databases

Production 10 min · MySQL / MariaDB

MySQL local_infile off

Stages local_infile = 0 and a localhost bind. It does not restart the database.

Baked-in protections

Step 1 · ini

Server snippet

/root/portgate-blueprints/portgate-mysql.cnf

Copy into the MySQL conf.d directory, then restart during a maintenance window.

[mysqld]
bind-address = 127.0.0.1
local_infile = 0
skip-symbolic-links

Step 2 · bash

Read-only check

/root/portgate-blueprints/mysql-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
ss -tulpn | grep 3306 || echo "Nothing is listening on 3306."