
Here’s a guide to getting MariaDB 10.5 up and running on your FreeBSD 13 system. This process is straightforward, ensuring you have a powerful and reliable database server ready for your applications.
First, it’s crucial to ensure your system is up-to-date. Open your terminal and run the following commands to update your package list and installed software:
sudo pkg update
sudo pkg upgrade
Once your system is current, you can proceed with the installation of the MariaDB server package. Use the package manager (pkg) for this:
sudo pkg install mariadb105-server
This command will download and install MariaDB 10.5 along with any necessary dependencies.
After the installation completes, it’s highly recommended to run the security script provided with MariaDB. This script helps improve the security of your database server by performing tasks like setting the root password, removing anonymous users, disallowing remote root login, and removing the test database. Execute the script with:
sudo mysqlsecureinstallation
Follow the prompts carefully. You’ll be asked to set a root password and answer a few yes/no questions regarding the security measures.
With the installation secured, you can now start the MariaDB service.
sudo service mysql-server start
To ensure MariaDB starts automatically every time your system boots, you need to enable the service in the system’s configuration files. Edit the /etc/rc.conf file and add the following line:
mysqlenable=”YES”
You can do this using a text editor like vi or ee, or with a command like:
echo ‘mysqlenable=”YES”‘ | sudo tee -a /etc/rc.conf
Finally, you can verify that the MariaDB service is running and accessible. You can attempt to log in as the root user (using the password you set during the security script):
mysql -u root -p
If you are prompted for the password and successfully log in to the MariaDB monitor, your installation is complete and working correctly.
By following these steps, you will have a secure and functional MariaDB 10.5 database server ready for use on your FreeBSD 13 system. This provides a solid foundation for hosting your data and running database-driven applications.
Source: https://kifarunix.com/install-mariadb-10-5-on-freebsd-13/