Documentation Home
MySQL and Linux/Unix
Related Documentation Download this Excerpt
PDF (US Ltr) - 374.0Kb
PDF (A4) - 376.2Kb


MySQL and Linux/Unix  /  Installing MySQL on FreeBSD

Chapter 4 Installing MySQL on FreeBSD

This section provides information about installing MySQL on variants of FreeBSD Unix.

You can install MySQL on FreeBSD by using the binary distribution provided by Oracle. For more information, seeChapter 1,Installing MySQL on Unix/Linux Using Generic Binaries.

The easiest (and preferred) way to install MySQL is to use themysql-server andmysql-client ports available athttp://www.freebsd.org/. Using these ports gives you the following benefits:

  • A working MySQL with all optimizations enabled that are known to work on your version of FreeBSD.

  • Automatic configuration and build.

  • Startup scripts installed in/usr/local/etc/rc.d.

  • The ability to usepkg_info -L to see which files are installed.

  • The ability to usepkg_delete to remove MySQL if you no longer want it on your machine.

The MySQL build process requires GNU make (gmake) to work. If GNUmake is not available, you must install it first before compiling MySQL.

To install using the ports system:

# cd /usr/ports/databases/mysql57-server# make...# cd /usr/ports/databases/mysql57-client# make...

The standard port installation places the server into/usr/local/libexec/mysqld, with the startup script for the MySQL server placed in/usr/local/etc/rc.d/mysql-server.

Some additional notes on the BSD implementation:

  • To remove MySQL after installation using the ports system:

    # cd /usr/ports/databases/mysql57-server# make deinstall...# cd /usr/ports/databases/mysql57-client# make deinstall...
  • If you get problems with the current date in MySQL, setting theTZ variable should help. SeeEnvironment Variables.