Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 39.4Mb
PDF (A4) - 39.4Mb
PDF (RPM) - 38.7Mb
HTML Download (TGZ) - 11.1Mb
HTML Download (Zip) - 11.1Mb
HTML Download (RPM) - 9.8Mb
Man Pages (TGZ) - 213.4Kb
Man Pages (Zip) - 322.6Kb
Info (Gzip) - 3.6Mb
Info (Zip) - 3.6Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  Installing and Upgrading MySQL  /  Installing MySQL on FreeBSD

2.8 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, see Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.

The easiest (and preferred) way to install MySQL is to use the mysql-server and mysql-client ports available at 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 use pkg_info -L to see which files are installed.

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

The MySQL build process requires GNU make (gmake) to work. If GNU make 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 the TZ variable should help. See Section 4.9, “MySQL Program Environment Variables”.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
  Posted by Joe Howes on May 29, 2012
It is possible during the installation of the server port to get user creation errors, for example:

===> Creating users and/or groups.
Creating group `mysql' with gid `88'.
Creating user `mysql' with uid `88'.
pw: user 'mysql' disappeared during update
*** Error code 67

This is caused by your FreeBSD user database being out of sync. Sync it with:

pwd_mkdb -p /etc/master.passwd

And then make install again and make will continue from the failure point.

Solution found at
Sign Up Login You must be logged in to post a comment.