{"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
In this tutorial, you will how to install MariaDB 10.5 on FreeBSD 13. \u201cMariaDB 10.5<\/a> is the current stable series of MariaDB. It is an evolution of MariaDB 10.4<\/a> with several entirely new features<\/a> not found anywhere else and with backported and reimplemented features from MySQL\u201d<\/em>.<\/p>\n\n\n\n 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 Follow the link below to upgrade it;<\/p>\n\n\n\n Upgrade FreeBSD 12 to 13<\/a><\/p>\n\n\n\n Assuming that you are installing MariaDB 10.5 on a newly installed FreeBSD 13, update and FreeBSD package catalogue.<\/p>\n\n\n\n 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 Therefore, to install MariaDB 10.5, simply execute the command below;<\/p>\n\n\n\n Once the installation is installed, you can start MariaDB on FreeBSD 13;<\/p>\n\n\n\n Checking the status of MariaDB service on FreeBSD 13<\/p>\n\n\n\n You can enable MariaDB to run on system boot using the command below;<\/p>\n\n\n\n Or simply run;<\/p>\n\n\n\n You would then be able to manage MariaDB service as follows;<\/p>\n\n\n\n To start MariaDB service;<\/p>\n\n\n\n To stop the service;<\/p>\n\n\n\n Disable the service from running on system boot;<\/p>\n\n\n\n Restart MariaDB 10.5 on FreeBSD 13<\/p>\n\n\n\n Check Status;<\/p>\n\n\n\n MariaDB comes with a default security script, Simply run the command below to launch the script.<\/p>\n\n\n\n The new installations of MariaDB have two secure accounts are created during the installation. The accounts are With or<\/p>\n\n\n\n Even if you run, As a user with sudo rights, prefix the commands above with If sudo is not installed, you can install it by running the command below;<\/p>\n\n\n\n Read more about MariaDB authentication plugins on MariaDB Knowledge base<\/a>.<\/p>\n\n\n\n Enable MariaDB password Authentication on FreeBSD 13<\/a><\/p>\n\n\n\n The 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 Similarly, you can login as mysql user;<\/p>\n\n\n\n To completely disable Next time you try to login without specifying the password, login will fail.<\/p>\n\n\n\n You can go ahead and perform your database tasks using MariaDB 10.5 on FreeBSD 13.<\/p>\n\n\n\n You can check our other guides on MariaDB\/MySQL installations by following the links below;<\/p>\n\n\n\n Install MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n Install MariaDB 10.3 on <\/a>Fedora<\/a> 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial, you will how to install MariaDB 10.5 on FreeBSD 13. \u201cMariaDB 10.5 is the current stable series of MariaDB. It is an evolution of MariaDB 10.4 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}]}}freebsd-version<\/code><\/pre>\n\n\n\n
13.0-RELEASE<\/code><\/pre>\n\n\n\n
Installing MariaDB 10.x on FreeBSD 13<\/h2>\n\n\n\n
Run System Update<\/h3>\n\n\n\n
pkg update<\/code><\/pre>\n\n\n\n
pkg upgrade<\/code><\/pre>\n\n\n\n
Install MariaDB 10.5<\/h3>\n\n\n\n
pkg search mariadb<\/code><\/pre>\n\n\n\n
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)\nmariadb105-client-10.5.9 Multithreaded SQL database (client)\nmariadb105-server-10.5.9 Multithreaded SQL database (server)<\/strong><\/code><\/pre>\n\n\n\n
pkg install mariadb105-server mariadb105-client<\/code><\/pre>\n\n\n\n
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? [y\/N]: y<\/code><\/pre>\n\n\n\n
Running MariaDB 10.5 on FreeBSD 13<\/h4>\n\n\n\n
service mysql-server onestart<\/code><\/pre>\n\n\n\n
service mysql-server onestatus<\/code><\/pre>\n\n\n\n
mysql is running as pid 1269.<\/code><\/pre>\n\n\n\n
sysrc mysql_enable=yes<\/code><\/pre>\n\n\n\n
service mysql-server enable<\/code><\/pre>\n\n\n\n
service mysql-server start<\/code><\/pre>\n\n\n\n
service mysql-server stop<\/code><\/pre>\n\n\n\n
service mysql-server disable<\/code><\/pre>\n\n\n\n
service mysql-server restart<\/code><\/pre>\n\n\n\n
service mysql-server status<\/code><\/pre>\n\n\n\n
Securing MariaDB 10.5 on FreeBSD 13<\/h3>\n\n\n\n
mysql_secure_installation <\/code><\/strong>that is used to improve the security of MariaDB installation by:<\/p>\n\n\n\n
\n
mysql_secure_installation<\/code><\/pre>\n\n\n\n
MariaDB 10.5 Authentication<\/h3>\n\n\n\n
root@localhost<\/code><\/strong> and
mysql@localhost<\/strong><\/code>. Both accounts uses either of the
unix_socket<\/code><\/strong> and the
mysql_native_password<\/code><\/strong> authentication plugins.<\/p>\n\n\n\n
unix_socket<\/strong><\/code> authentication plugin allows a system
root<\/code> user or a
user with sudo rights<\/strong><\/code> to login as
root@locahost<\/strong><\/code> to MariaDB database without a password. You can even login as mysql user.<\/p>\n\n\n\n
unix_socket<\/strong><\/code> 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
mysql<\/code><\/pre>\n\n\n\n
mysql -u root<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/strong><\/code>, and press ENTER for blank password, you will still login.<\/p>\n\n\n\n
sudo<\/strong><\/code>.<\/p>\n\n\n\n
pkg install sudo<\/code><\/pre>\n\n\n\n
mysql_native_password<\/code> plugin is used as a failover for the
unix_socket<\/code> 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
mysql<\/code><\/pre>\n\n\n\n
set password = password(\"P@sSw0Rd123\");<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
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 [(none)]><\/code><\/pre>\n\n\n\n
sudo -u mysql mysql<\/code><\/pre>\n\n\n\n
Set Native Password Authentication Method as Default<\/h4>\n\n\n\n
unix_socke<\/code>t authentication plugin and instead use the
msqyl_native_password<\/code> authentication method, simply login to MariaDB and change the authentication plugin for root<\/strong> user.<\/p>\n\n\n\n
mysql<\/code><\/pre>\n\n\n\n
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\"MyPQQSSword\");<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
sudo mysql -u root<\/code><\/pre>\n\n\n\n
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/code><\/pre>\n\n\n\n