Compiling ProxySQL on FreeBSD

Compiling ProxySQL 1.4.6 on FreeBSD 11.1

FreeBSD is the operating system of choice for many MySQL installations and a topic that often comes up in the ProxySQL Google Forums as well as the ProxySQL Github Issue Tracker is related to ProxySQL on FreeBSD. An official package for FreeBSD (and BSD in general) is not available in the ProxySQL releases however it is in fact possible to compile ProxySQL on FreeBSD.

In this blog article we outline the steps in order to compile ProxySQL 1.4.6 on FreeBSD 11.1.

Firstly, you'll need a copy of FreeBSD 11.1 available here (the amd64 Virtual Machine Image was used to prepare this article). Once you've installed the operating system you'll need to install the following pre-requisite packages in order to compile (this can be done either with ports or the pkg package manager):

Once this completes you'll have the compiled binary in the /src directory and you can install with sudo gmake install or just start the binary directly in the background specifying the datadir e.g. proxysql -D .. Please keep in mind that you might manually need to create the /var/lib directory before running install in case it is not present and you'll also have to add you own FreeBSD compatible rc.d startup script if needed.