Skip to navigation
Setup MariaDB on FreeBSD
21.06.24
Prerequisites To get started, confirm that you have got the following: A FreeBSD 14 server. Read more: FreeBSD 14: Step-by-Step Installation (With Screenshot) A root user or non-root user with sudo or administrator privileges. Installing MariaDB Server on FreeBSD By default, the FreeBSD repository provides multiple versions of MariaDB servers. To install MariaDB on your FreeBSD server, complete the following tasks: 1. First, run the command below to update the FreeBSD repository and get the latest package information. pkg update pkg search mariadb As seen in the following, the FreeBSD repository provides MariaDB servers 10.11, 10.6, and 10.5. Updating FreeBSD repository and searching mariadb packages 2. Run the command below to install the MariaDB 10.11 to the FreeBSD server. pkg install mariadb1011-server mariadb1011-client Input y to proceed with the installation. Installing MariaDB 10.11 Installing MariaDB 10.11 3. Once installation is complete, run the command below to enable and verify MariaDB service. sysrc mysql_enable="YES" sysrc -a | grep mysql Enable and verify MariaDB service Enable and verify MariaDB service 4. Lastly, run the mariadb command below to check the MariaDB server version. mariadb --version You will see that MariaDB 10.11 is installed. Checking MariaDB version Checking MariaDB version Managing MariaDB Service on FreeBSD Now that you have installed and enabled the MariaDB server, take a look at how to manage the MariaDB server via the service command. Learn how to start, verify, stop, and restart MariaDB using these steps: 1. Run the command below to start the MariaDB server on your FreeBSD system. The first time you run this, you will initialize the MariaDB data directory to the /var/db/mysql directory. service mysql-server start Starting MariaDB server Starting MariaDB server 2. Once the MariaDB server starts, run the following command to verify it. service mysql-server status In the following output, you can see the MariaDB server is running on a process ID (PID) 2639. Checking MariaDB service Checking MariaDB service 3. If you need to stop the MariaDB server, run the command below. service mysql-server stop 4. Lastly, run the following command to restart the MariaDB server when needed. service mysql-server restart Securing MariaDB Server via mariadb-secure-installation With the MySQL/MariaDB up and running, move on to set up the MariaDB root password to secure the deployment using the mariadb-secure-installation utility. Proceed with these steps to secure your MariaDB server installation: 1. Execute the mariadb-secure-installation command below to start the configuration. mariadb-secure-installation Press ENTER when prompted for the root password. The MariaDB root user comes without a password. Securing MariaDB using mariadb_secure_installation Securing MariaDB using mariadb_secure_installation 2. Input Y to enable unix_socket authentication for the root user. Switching MariaDB root authentication via unix_socket Switching MariaDB root authentication via unix_socket 3. Input Y again to set up the root password. Then, input your password and repeat. Setting up MariaDB root password Setting up MariaDB root password 4. Input Y to delete the default anonymous user from your MariaDB server. Removing default anonymous user Removing default anonymous user 5. Then, input Y when asked to disable the remote authentication for the root user. Disallow remote login for MariaDB root user Disallow remote login for MariaDB root user 6. Now input Y to remove the default database test and its privileges. Removing default database test and its privileges Removing default database test and its privileges 7. Lastly, input Y again to reload table privileges and apply your modification to the MariaDB server. Once the process is complete, you will see an output All done! …. your MariaDB installation should now be secure.
https://geekandnix.com/freebsd/install-mariadb/
Reply
Anonymous
Information Epoch 1738773931
Design for visibility.
Home
Notebook
Contact us