How to install MySQL on FreeBSD using Packages

It is quite easy to install MySQL on FreeBSD using packages. I normally like to install from source but packages are so simple and quick to upgrade it is useful to use them if you don’t require any special make options. This is the following commands I use to install MySQL with all the appropriate things done for it to run nicely.

pkg_add -r mysql51-server
nano /etc/rc.conf
Add the following line
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password newpassword

No Comments Yet.

Write a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.