{"id":9130,"date":"2021-06-17T18:49:43","date_gmt":"2021-06-17T15:49:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9130"},"modified":"2024-03-18T20:58:56","modified_gmt":"2024-03-18T17:58:56","slug":"install-mariadb-10-x-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-x-on-rocky-linux-8\/","title":{"rendered":"Install MariaDB 10.x on Rocky Linux 8"},"content":{"rendered":"\n
This guide will take you through how to install MariaDB 10.x on Rocky Linux 8 system. As of this writing, MariaDB 10.5.10 is the current stable<\/strong> (GA) series of MariaDB based on MariaDB releases page<\/a>.<\/p>\n\n\n\n You can read more about MariaDB 10.5 on its release notes<\/a> page.<\/p>\n\n\n\n The default Rocky Linux 8 AppStream repos provides MariadDB 10.3 (As of this writing).<\/p>\n\n\n\n Therefore, if you need to install say, the latest stable release version of MariaDB, 10.5.10, on Rocky Linux, then you have to install MariaDB YUM repos.<\/p>\n\n\n\n To install MariaDB 10.5.10, for instance, you need to install MariaDB YUM repository.<\/p>\n\n\n\n Next, install MariaDB YUM repository signing key.<\/p>\n\n\n\n To install MariaDB 10.4 from the repos created above, simply run the command below;<\/p>\n\n\n\n To start MariaDB service;<\/p>\n\n\n\n To enable MariaDB to run on system boot;<\/p>\n\n\n\n To check the status of MariaDB;<\/p>\n\n\n\n Verify the MariaDB installed version.<\/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 MariaDB is installed with two secure accounts of MariaDB 10.5, root@localhost<\/strong> and The Unix_socket plugins works when connection to MariaDB is made from the localhost as a root user. You can simply login running the command (as root or with sudo);<\/p>\n\n\n\n The This re-enables the MariaDB password authentication.<\/p>\n\n\n\n If you need to change the Next time you try to login without specifying the password, login will fail.<\/p>\n\n\n\n Read more about authentications on MariaDB Authentication plugins<\/a>.<\/p>\n\n\n\n That is all on our guide on how to install MariaDB 10.x.<\/p>\n\n\n\n You can now use MariaDB as you wish.<\/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":" This guide will take you through how to install MariaDB 10.x on Rocky Linux 8 system. As of this writing, MariaDB 10.5.10 is the current stable (GA)<\/p>\n","protected":false},"author":1,"featured_media":9145,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,121,928,929],"tags":[],"class_list":["post-9130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-howtos","category-mariadb","category-mysql","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\/9130"}],"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=9130"}],"version-history":[{"count":7,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9130\/revisions"}],"predecessor-version":[{"id":21793,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9130\/revisions\/21793"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9145"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=9130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=9130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=9130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}Installing MariaDB 10.x on Rocky Linux 8<\/h2>\n\n\n\n
Install MariaDB 10.x YUM Repository on Rocky Linux<\/h3>\n\n\n\n
cat << EOL > \/etc\/yum.repos.d\/mariadb.repo\n[mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/10.5\/rhel8-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1\nmodule_hotfixes=1\nEOL<\/code><\/pre>\n\n\n\n
rpm --import https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<\/code><\/pre>\n\n\n\n
Install MariaDB 10.x<\/h3>\n\n\n\n
dnf install MariaDB-server MariaDB-client<\/code><\/pre>\n\n\n\n
Running MariaDB on Rocky Linux 8<\/h3>\n\n\n\n
systemctl start mariadb<\/code><\/pre>\n\n\n\n
systemctl enable mariadb<\/code><\/pre>\n\n\n\n
systemctl status mariadb<\/code><\/pre>\n\n\n\n
\u25cf mariadb.service - MariaDB 10.5.10 database server\n Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; disabled; vendor preset: disabled)\n Drop-In: \/etc\/systemd\/system\/mariadb.service.d\n \u2514\u2500migrated-from-my.cnf-settings.conf\n Active: active (running) since Thu 2021-06-17 13:53:58 EAT; 3min 48s ago\n Docs: man:mariadbd(8)\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Process: 47394 ExecStartPost=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n Process: 47369 ExecStartPre=\/bin\/sh -c [ ! -e \/usr\/bin\/galera_recovery ] && VAR= || VAR=`cd \/usr\/bin\/..; \/usr\/bin\/galera_recovery`; [ $? -eq 0 ] && systemctl set-env>\n Process: 47367 ExecStartPre=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n Main PID: 47379 (mariadbd)\n Status: \"Taking your SQL requests now...\"\n Tasks: 9 (limit: 4938)\n Memory: 103.8M\n CGroup: \/system.slice\/mariadb.service\n \u2514\u250047379 \/usr\/sbin\/mariadbd\n\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] Plugin 'FEEDBACK' is disabled.\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: Loading buffer pool(s) from \/var\/lib\/mysql\/ib_buffer_pool\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: Buffer pool(s) load completed at 210617 13:53:56\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] Server socket created on IP: '::'.\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] Reading of all Master_info entries succeeded\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] Added new Master_info '' to hash table\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] \/usr\/sbin\/mariadbd: ready for connections.\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: Version: '10.5.10-MariaDB' socket: '\/var\/lib\/mysql\/mysql.sock' port: 3306 MariaDB Server\nJun 17 13:53:58 localhost.localdomain systemd[1]: Started MariaDB 10.5.10 database server.\n<\/code><\/pre>\n\n\n\n
mysql -V<\/code><\/pre>\n\n\n\n
mysql Ver 15.1 Distrib 10.5.10-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n\n\n\n
Securing MariaDB<\/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
mysql@localhost<\/code><\/strong>.<\/p>\n\n\n\n
root@localhost<\/code><\/strong> uses both the
unix_socket<\/code><\/strong> and the
mysql_native_password<\/code><\/strong> authentication plugins.<\/p>\n\n\n\n
mysql<\/code><\/pre>\n\n\n\n
mysql -u root<\/code><\/pre>\n\n\n\n
mysql_native_password<\/code> plugin is used as a failover for the unix_socket 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
Set Native Password Authentication Method as Default<\/a><\/h3>\n\n\n\n
unix_socke<\/code>t plugin authentication to the
msqyl_native_password<\/code> authentication method, simply login to MariaDB and change the authentication plugin for root 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
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
Other Tutorials<\/h3>\n\n\n\n