Tutorial: freebsd mysql

Simple way to install mysql server on your FreeBSD machine:

  1. Install package

    pkg install mysql56-server
  2. Enable mysql service

    sysrc mysql_enable=yes
  3. Start mysql service

    service mysql-server start
  4. Run secure installation script

    mysql_secure_installation
  5. Block mysql port - except localhost

    nano /etc/pf.conf
    block in on vr1 proto tcp from any to ! 127.0.0.1 port 3306