Wednesday, July 5, 2017

FreeBSD: Install MariaDB on FreeBSD 11.0



FreeBSD is one of the oldest operating system that still exist today. Even if its an old, it keeps updating everyday and their community are working hard to to establish a working and competing operating system today. It is an operating system that focuses on speed and stability. What I like about it, is that it offers more tools and commands for advance networking, performance and security. Security is one of the important factors that people keep comming back for FreeBSD.  As a server, It also an ideal intranet server because it uses memory efficiency. Because of this positive improvement on the operating system, we will install MariaDB to find out how fast , stable and efficent it is. 



1. We are going to use FreeBSD Ports Collection to install MariaDB. We will navigate FreeBSD ports and after then, we can install MariaDB. After you change directory to /usr/ports/databases/mariadb101-server, you can now trigger the command make install clean to install MariaDB into your system.


cd /usr/ports/databases/mariadb101-server/


make install clean



most of the time, you need to choose ok because they are dependencies that you need to download in order to work MariaDB properly. 




2. After installing MariaDB, its not done yet. You need to configure it to work. In the below code states that im going to add the line 'mysql_enable="YES"' to the file name rc.conf in the directory /etc/. After that, we need to start the mysql server by triggering the command service mysql-server start. If you dont start mysql-server, you can't start the mysql_secure_installation. So before you trigger mysql_secure_installation, dont forget to start the mysql server. 


echo 'mysql_enable="YES"' >> /etc/rc.conf



service mysql-server start



mysql_secure_installation



Set root password? Y
Remove anonymous users? Y
Disallow root login remotely? n
Remove test database and access to it? Y
Reload privilege tables now? Y


3. Test MariaDB by triggering the command mysql -u root -p. After that you need to enter your password for MariaDB and eventually, you are connected to the application. Type help if you are not familiar with mariadb and the help command will help you to do what you need in your database system.


mysql -u root -p


No comments:

Post a Comment