{"id":5536,"date":"2023-11-27T11:57:51","date_gmt":"2023-11-27T11:57:51","guid":{"rendered":"https:\/\/natsav.com\/blog\/?p=5536"},"modified":"2024-02-01T12:06:10","modified_gmt":"2024-02-01T12:06:10","slug":"install-mariadb-on-ubuntu","status":"publish","type":"post","link":"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/","title":{"rendered":"A Comprehensive Guide to Installing MariaDB on Ubuntu"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_68_1 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/#Installing_MariaDB_on_Ubuntu\" title=\"Installing MariaDB on Ubuntu\">Installing MariaDB on Ubuntu<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/#Step_1_Update_Package_Lists\" title=\"Step 1: Update Package Lists\">Step 1: Update Package Lists<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/#Step_2_Install_MariaDB_Server\" title=\"Step 2: Install MariaDB Server\">Step 2: Install MariaDB Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/#Step_3_Secure_MariaDB_Installation\" title=\"Step 3: Secure MariaDB Installation\">Step 3: Secure MariaDB Installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/natsav.com\/blog\/install-mariadb-on-ubuntu\/#Step_4_Start_and_Enable_MariaDB\" title=\"Step 4: Start and Enable MariaDB\">Step 4: Start and Enable MariaDB<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Installing_MariaDB_on_Ubuntu\"><\/span>Installing MariaDB on Ubuntu<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Update_Package_Lists\"><\/span>Step 1: Update Package Lists<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Just like with MySQL, start by updating your package lists:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">#sudo apt update<br \/>\n<\/code><\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_Install_MariaDB_Server\"><\/span>Step 2: Install MariaDB Server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Install the MariaDB server package with the following command:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"p-4 overflow-y-auto\">#<code class=\"!whitespace-pre hljs language-bash\">sudo apt install mariadb-server<br \/>\n<\/code><\/div>\n<\/div>\n<p>During the installation, you will be prompted to set a root password for MariaDB. Choose a strong password and remember it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_3_Secure_MariaDB_Installation\"><\/span>Step 3: Secure MariaDB Installation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>MariaDB also provides a script to secure your <a href=\"https:\/\/natsav.com\/blog\/install-php-7-4-in-ubuntu\/\"><strong>installation<\/strong><\/a>. Run the following command:<br \/>\n<code class=\"!whitespace-pre hljs language-bash\">sudo mysql_secure_installation<\/code><\/p>\n<p>Follow the prompts to configure security options, similar to the MySQL setup.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_4_Start_and_Enable_MariaDB\"><\/span>Step 4: Start and Enable MariaDB<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Start the MariaDB service and enable it to start on boot:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">sudo systemctl start mariadb<br \/>\nsudo systemctl <span class=\"hljs-built_in\">enable<\/span> mariadb<br \/>\n<\/code><\/div>\n<\/div>\n<p>MariaDB is now installed and running on your Ubuntu machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing MariaDB on Ubuntu Step 1: Update Package Lists Just like with MySQL, start by updating your package lists: #sudo apt update Step 2: Install MariaDB Server Install the MariaDB server package with the following command: #sudo apt install mariadb-server During the installation, you will be prompted to set a root password for MariaDB. Choose [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5539,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[255],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2023\/11\/ubuntu-maria-db-2.png?fit=489%2C251&ssl=1","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5536"}],"collection":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/comments?post=5536"}],"version-history":[{"count":5,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5536\/revisions"}],"predecessor-version":[{"id":5851,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5536\/revisions\/5851"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/media\/5539"}],"wp:attachment":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/media?parent=5536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/categories?post=5536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/tags?post=5536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}