Install MariaDB Databases on a FreeBSD 11 Unix Server

To install MariaDB on a FreeBSD 11 server, you can use the following steps:

  1. Add the MariaDB repository to your system’s package sources list. This can be done by creating a file in the /usr/local/etc/pkg/repos directory with the following contents:
sudo nano /usr/local/etc/pkg/repos/MariaDB.conf
MariaDB: {
url: "pkg+http://ftp.osuosl.org/pub/mariadb/repo/10.5/freebsd11-amd64",
enabled: yes
}
  1. Update your system’s package database to include the new repository:
sudo pkg update
  1. Install the MariaDB server package:
sudo pkg install mariadb105-server
  1. Enable the MariaDB service to start automatically at boot:
sudo sysrc mysql_enable=yes
  1. Start the MariaDB service:
sudo service mysql-server start
  1. Secure the MariaDB installation by running the mysql_secure_installation script:
sudo mysql_secure_installation

This script will prompt you to set a root password, remove anonymous users, disallow remote root logins, and remove the test database.

After completing these steps, MariaDB should be installed and running on your FreeBSD 11 server. You can log in to the MariaDB prompt by running the mysql command as the root user.

Leave a Comment