tommyt1 I reproduced this on MariaDB 12.1.2, the same version you are running, with an unprivileged dev user. Setting init_connect to an over-quoted value produces your error exactly, SQLSTATE[08S01]: Communication link failure: 1184 Aborted connection ... (init_connect command failed), and the server log line is identical to yours, You have an error in your SQL syntax ... near ''SET NAMES utf8'' at line 1. Clearing the variable makes the same connection succeed immediately.
In that same test root connected normally while dev was being rejected, because init_connect is skipped for privileged accounts. That is why phpMyAdmin has worked for nine months: it is almost certainly connecting as root, so it never runs the statement at all. Its working tells you nothing about whether dev can connect.
So the value is still set. Run SELECT @@global.init_connect; and you can settle it in one query. If it returns anything, the file you edited is not the one the server actually reads, and the service may well be started with an explicit --defaults-file that overrides every default location. You do not need to find that file to get moving: SET GLOBAL init_connect = ''; clears it right now, with no restart, and you can run the installer straight after.
If you do want to keep an init_connect, make it SET NAMES utf8mb4. I tested the correctly quoted SET NAMES utf8 too, and it connects but leaves the session on utf8mb3, which works against the utf8mb4 Flarum uses.