To install MariaDB on a FreeBSD 11 server, you can use the following steps:
- 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
}
- Update your system’s package database to include the new repository:
sudo pkg update
- Install the MariaDB server package:
sudo pkg install mariadb105-server
- Enable the MariaDB service to start automatically at boot:
sudo sysrc mysql_enable=yes
- Start the MariaDB service:
sudo service mysql-server start
- 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.