{"id":8659,"date":"2021-04-15T20:42:31","date_gmt":"2021-04-15T17:42:31","guid":{"rendered":"https:\/\/kifarunix.com\/?p=8659"},"modified":"2024-03-18T23:01:31","modified_gmt":"2024-03-18T20:01:31","slug":"install-mariadb-10-5-on-freebsd-13","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-5-on-freebsd-13\/","title":{"rendered":"Install MariaDB 10.5 on FreeBSD 13"},"content":{"rendered":"\n<p>In this tutorial, you will how to install MariaDB 10.5 on FreeBSD 13. \u201c<em><a rel=\"noreferrer noopener\" href=\"https:\/\/mariadb.com\/kb\/en\/what-is-mariadb-105\/\" target=\"_blank\">MariaDB 10.5<\/a>&nbsp;is the current&nbsp;stable&nbsp;series of MariaDB. It is an evolution of&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/mariadb.com\/kb\/en\/what-is-mariadb-104\/\" target=\"_blank\">MariaDB 10.4<\/a>&nbsp;with several entirely&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/mariadb.com\/kb\/en\/changes-improvements-in-mariadb-105\/\" target=\"_blank\" class=\"rank-math-link\">new features<\/a>&nbsp;not found anywhere else and with backported and reimplemented features from MySQL\u201d<\/em>.<\/p>\n\n\n\n<p>Are you still running FreeBSD 12? Hold on, FreeBSD 13.0 has been released and you can now backup your data and upgrade your FreeBSD 12 box to FreeBSD 13.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>freebsd-version<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>13.0-RELEASE<\/code><\/pre>\n\n\n\n<p>Follow the link below to upgrade it;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/upgrade-freebsd-12-to-13\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Upgrade FreeBSD 12 to 13<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing MariaDB 10.x on FreeBSD 13<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run System Update<\/h3>\n\n\n\n<p>Assuming that you are installing MariaDB 10.5 on a newly installed FreeBSD 13, update and FreeBSD package catalogue.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-mariadb-10.5-from-apt-repos\">Install MariaDB 10.5<\/h3>\n\n\n\n<p>The FreeBSD 13 package catalogue provides the latest stable release versions of MariaDB, which is MariaDB 10.5.9 as of this writing.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg search mariadb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mariadb-connector-c-3.1.10     MariaDB database connector for C\nmariadb-connector-odbc-3.1.11  MariaDB database connector for odbc\nmariadb103-client-10.3.28_1    Multithreaded SQL database (client)\nmariadb103-server-10.3.28      Multithreaded SQL database (server)\nmariadb104-client-10.4.18      Multithreaded SQL database (client)\nmariadb104-server-10.4.18      Multithreaded SQL database (server)\n<strong>mariadb105-client-10.5.9       Multithreaded SQL database (client)\nmariadb105-server-10.5.9       Multithreaded SQL database (server)<\/strong><\/code><\/pre>\n\n\n\n<p>Therefore, to install MariaDB 10.5, simply execute the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg install mariadb105-server mariadb105-client<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Updating FreeBSD repository catalogue...\nFreeBSD repository is up to date.\nAll repositories are up to date.\nThe following 14 package(s) will be affected (of 0 checked):\n\nNew packages to be INSTALLED:\n\tboost-libs: 1.72.0_3\n\tgalera26: 26.4.6_1\n\ticu: 68.2,1\n\tlibedit: 3.1.20210216,1\n\tlibiconv: 1.16\n\tliblz4: 1.9.3,1\n\tlibxml2: 2.9.10_3\n\tmariadb105-client: 10.5.9\n\tmariadb105-server: 10.5.9\n\tpcre2: 10.36\n\trsync: 3.2.3\n\tunixODBC: 2.3.9\n\txxhash: 0.8.0\n\tzstd: 1.4.8\n\nNumber of packages to be installed: 14\n\nThe process will require 473 MiB more space.\n57 MiB to be downloaded.\n\nProceed with this action? &#91;y\/N]: y<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running MariaDB 10.5 on FreeBSD 13<\/h4>\n\n\n\n<p>Once the installation is installed, you can start MariaDB on FreeBSD 13;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server onestart<\/code><\/pre>\n\n\n\n<p>Checking the status of MariaDB service on FreeBSD 13<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server onestatus<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql is running as pid 1269.<\/code><\/pre>\n\n\n\n<p>You can enable MariaDB to run on system boot using the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sysrc mysql_enable=yes<\/code><\/pre>\n\n\n\n<p>Or simply run;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server enable<\/code><\/pre>\n\n\n\n<p id=\"block-c81257d2-a6c6-408e-9a6e-1deb55c9ea11\">You would then be able to manage MariaDB service as follows;<\/p>\n\n\n\n<p>To start MariaDB service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server start<\/code><\/pre>\n\n\n\n<p>To stop the service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server stop<\/code><\/pre>\n\n\n\n<p>Disable the service from running on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server disable<\/code><\/pre>\n\n\n\n<p>Restart MariaDB 10.5 on FreeBSD 13<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server restart<\/code><\/pre>\n\n\n\n<p>Check Status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service mysql-server status<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Securing MariaDB 10.5 on FreeBSD 13<\/h3>\n\n\n\n<p>MariaDB comes with a default security script,&nbsp;<strong><code>mysql_secure_installation&nbsp;<\/code><\/strong>that is used to improve the security of MariaDB installation by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setting the password for root accounts (if need be).<\/li>\n\n\n\n<li>Disabling remote root login to the databases.<\/li>\n\n\n\n<li>Removing anonymous-user accounts.<\/li>\n\n\n\n<li>Removing the test database, which by default can be accessed by anonymous users.<\/li>\n<\/ul>\n\n\n\n<p>Simply run the command below to launch the script.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">MariaDB 10.5 Authentication<\/h3>\n\n\n\n<p>The new installations of MariaDB have two secure accounts are created during the installation. The accounts are&nbsp;<strong><code>root@localhost<\/code><\/strong>&nbsp;and&nbsp;<code><strong>mysql@localhost<\/strong><\/code>. Both accounts uses either of the&nbsp;<strong><code>unix_socket<\/code><\/strong>&nbsp;and the&nbsp;<strong><code>mysql_native_password<\/code><\/strong>&nbsp;authentication plugins.<\/p>\n\n\n\n<p><code><strong>unix_socket<\/strong><\/code>&nbsp;authentication plugin allows a system&nbsp;<code>root<\/code>&nbsp;user or a&nbsp;<code><strong>user with sudo rights<\/strong><\/code>&nbsp;to login as&nbsp;<code><strong>root@locahost<\/strong><\/code>&nbsp;to MariaDB database without a password. You can even login as mysql user.<\/p>\n\n\n\n<p>With&nbsp;<code><strong>unix_socket<\/strong><\/code>&nbsp;authentication plugin, while being a root user, or user with sudo rights you can simply login by running either of the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root<\/code><\/pre>\n\n\n\n<p>Even if you run,&nbsp;<code><strong>mysql -u root -p<\/strong><\/code>, and press ENTER for blank password, you will still login.<\/p>\n\n\n\n<p>As a user with sudo rights, prefix the commands above with&nbsp;<code><strong>sudo<\/strong><\/code>.<\/p>\n\n\n\n<p>If sudo is not installed, you can install it by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg install sudo<\/code><\/pre>\n\n\n\n<p>Read more about MariaDB authentication plugins on&nbsp;<a href=\"https:\/\/mariadb.com\/kb\/en\/authentication-plugins\/\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB Knowledge base<\/a>.<\/p>\n\n\n\n<p id=\"enable-mariadb-native-password-authentication\"><a class=\"rank-math-link\" href=\"https:\/\/kifarunix.com\/easily-install-mariadb-10-5-on-freebsd-12-1\/#enable%20mariadb-native-password-authentication\">Enable MariaDB password Authentication on FreeBSD 13<\/a><\/p>\n\n\n\n<p>The&nbsp;<code>mysql_native_password<\/code>&nbsp;plugin is used as a failover for the&nbsp;<code>unix_socket<\/code>&nbsp;plugin. However, the account has an invalid password. To enable password authentication, you need to login to MariaDB as root user as shown above and set the password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>set password = password(\"P@sSw0Rd123\");<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<p>This re-enables the MariaDB password authentication and hence, you can now login as non root or non sudo user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Welcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 10\nServer version: 10.5.9-MariaDB FreeBSD Ports\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nroot@localhost &#91;(none)]&gt;<\/code><\/pre>\n\n\n\n<p>Similarly, you can login as mysql user;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u mysql mysql<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Set Native Password Authentication Method as Default<\/h4>\n\n\n\n<p>To completely disable&nbsp;<code>unix_socke<\/code>t authentication plugin and instead use the&nbsp;<code>msqyl_native_password<\/code>&nbsp;authentication method, simply login to MariaDB and change the authentication plugin for&nbsp;<strong>root<\/strong>&nbsp;user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\"MyPQQSSword\");<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<p>Next time you try to login without specifying the password, login will fail.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo mysql -u root<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/code><\/pre>\n\n\n\n<p>You can go ahead and perform your database tasks using MariaDB 10.5 on FreeBSD 13.<\/p>\n\n\n\n<p>You can check our other guides on MariaDB\/MySQL installations by following the links below;<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" class=\"rank-math-link\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-on-debian-10-buster\/\" target=\"_blank\">Install MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-4-on-ubuntu-18-04-debian-9\/\" target=\"_blank\">Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-centos-7\/\" target=\"_blank\">Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\">Install MariaDB 10.3 on&nbsp;<\/a><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fedora<\/a><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\">&nbsp;30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will how to install MariaDB 10.5 on FreeBSD 13. \u201cMariaDB 10.5&nbsp;is the current&nbsp;stable&nbsp;series of MariaDB. It is an evolution of&nbsp;MariaDB 10.4&nbsp;with<\/p>\n","protected":false},"author":1,"featured_media":8667,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[3439,3441,3440,3443,3442,3444],"class_list":["post-8659","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-freebsd-13","tag-freebsd-13-mariadb","tag-install-mariadb-10-5-freebsd-13","tag-install-mariadb-on-freebsd","tag-mariadb-10-5-freebsd-13","tag-mariadb-10-5-9","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8659"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=8659"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8659\/revisions"}],"predecessor-version":[{"id":21843,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8659\/revisions\/21843"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/8667"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=8659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=8659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=8659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}