{"id":15996,"date":"2021-12-10T08:09:49","date_gmt":"2021-12-10T08:09:49","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15996"},"modified":"2024-06-26T07:34:03","modified_gmt":"2024-06-26T07:34:03","slug":"how-to-install-and-setup-phpmyadmin-on-ubuntu","status":"publish","type":"post","link":"\/uk\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","title":{"rendered":"How to Install phpMyAdmin on Ubuntu"},"content":{"rendered":"<p>phpMyAdmin is a popular administrative tool for managing MariaDB and MySQL databases through a user-friendly web interface. It lets you execute database administration tasks such as running queries, managing users and permissions, and exporting and importing databases.<\/p><p>Setting up phpMyAdmin on a Linux-based virtual private server (VPS) allows for efficient and secure remote database management. In this article, you&rsquo;ll learn how to install and configure phpMyAdmin on an Ubuntu server.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/SSH-Cheat-Sheet-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download ultimate SSH commands cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites-for-installing-phpmyadmin\">Prerequisites for Installing phpMyAdmin<\/h2><p>Before installing phpMyAdmin, make sure your server meets all the necessary requirements:<\/p><ul class=\"wp-block-list\">\n<li><strong>Ubuntu VPS<\/strong>. Your VPS should run on recent supported versions of Ubuntu, such as Ubuntu <strong>22.04<\/strong> or <strong>24.04<\/strong>. If you don&rsquo;t own a server, consider <a href=\"\/uk\/vps\/ubuntu-hosting\">purchasing an Ubuntu VPS plan<\/a> from a reputable provider.<\/li>\n\n\n\n<li><strong>LAMP stack installation<\/strong>. Ensure you have installed the Apache web server, MySQL server, and PHP and its required extensions to run phpMyAdmin. If you haven&rsquo;t configured them yet, check our guide on <a href=\"\/uk\/tutorials\/how-to-install-lamp-on-ubuntu\">installing the LAMP stack on Ubuntu<\/a>.<\/li>\n<\/ul><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/uk\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-install-phpmyadmin-on-ubuntu\">How to Install phpMyAdmin on Ubuntu<\/h2><p>Now that your server is prepared, let&rsquo;s install phpMyAdmin. In this tutorial, we&rsquo;ll use the <strong>Ubuntu 22.04 with LAMP Stack<\/strong> template from Hostinger&rsquo;s VPS.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab316207\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"384\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-1024x384.png\" alt=\"Choosing the Ubuntu 22.04 with LAMP Stack VPS template on Hostinger's hPanel\" class=\"wp-image-109247\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-1024x384.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-300x113.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-150x56.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-768x288.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-1536x576.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/hpanel-vps-operating-system-ubuntu-22-04-with-lamp-stack-highlighted-2048x768.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-1-install-the-phpmyadmin-package\">1. Install the phpMyAdmin Package<\/h3><p>Make sure you are logged into your Ubuntu server and update your package list before installing phpMyAdmin. Here are the complete instructions:<\/p><ol class=\"wp-block-list\">\n<li>Open any terminal software installed on your computer. Then, access your server by running the following command. Replace <strong>user<\/strong> with your actual username and <strong>ip_address<\/strong> with your server&rsquo;s IP address:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">ssh user@ip_address<\/pre><ol class=\"wp-block-list\" start=\"2\">\n<li>Update and upgrade your package list in the default Ubuntu repositories with this <a href=\"\/uk\/tutorials\/linux-commands\">Linux command<\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/pre><p>We recommend installing phpMyAdmin with these PHP modules using the <strong>apt<\/strong> package manager:<\/p><ul class=\"wp-block-list\">\n<li><strong>php-mbstring<\/strong>. Enables support for multibyte strings, enhancing non-ASCII string handling.<\/li>\n\n\n\n<li><strong>php-zip<\/strong>. Allows PHP to handle ZIP archives.<\/li>\n\n\n\n<li><strong>php-gd<\/strong>. Provides tools for manipulating image data.<\/li>\n\n\n\n<li><strong>php-json<\/strong>. Supports JSON serialization and deserialization.<\/li>\n\n\n\n<li><strong>php-curl<\/strong>. Enables PHP to communicate with other servers via URL syntax.<\/li>\n<\/ul><p>To do so, run the following command:<\/p><pre class=\"wp-block-preformatted\">sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl -y<\/pre><ol class=\"wp-block-list\" start=\"3\">\n<li>You&rsquo;ll be prompted to choose the web server. Select <strong>apache2<\/strong> by pressing <strong>Space &rarr; Tab &rarr; Enter<\/strong> on your keyboard.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab318f9f\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"363\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted-1024x363.png\" alt=\"Selecting Apache as the web server when configuring phpMyAdmin\" class=\"wp-image-109248\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted-1024x363.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted-300x106.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted-150x53.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted-768x272.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-apache2-highlighted.png 1404w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"4\">\n<li>Initiate the database setup with <strong>dbconfig-common<\/strong> by selecting <strong>Yes<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab31badb\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"181\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-1024x181.png\" alt=\"Configuring database with dbconfig-common\" class=\"wp-image-109249\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-1024x181.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-300x53.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-150x27.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-768x136.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-1536x272.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-yes-selected-2048x363.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Create and confirm a new MySQL application password when prompted. Make sure to choose a strong password that combines letters, numbers, and special characters to improve security.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab31e296\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"204\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-1024x204.png\" alt=\"Creating a new MySQL application password when configuring phpMyAdmin\" class=\"wp-image-109250\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-1024x204.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-300x60.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-150x30.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-768x153.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected-1536x305.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/terminal-configuring-phpmyadmin-ok-selected.png 1952w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"6\">\n<li>Activate the <strong>mbstring<\/strong> PHP extension by executing the following:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo phpenmod mbstring<\/pre><ol class=\"wp-block-list\" start=\"7\">\n<li>Restart the Apache server to apply all configurations:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl restart apache2<\/pre><h3 class=\"wp-block-heading\" id=\"h-2-configure-user-permissions\">2. Configure User Permissions<\/h3><p>Once you&rsquo;re done with the phpMyAdmin installation, the next step is to configure MySQL user permissions for secure and efficient database management. Here&rsquo;s the guide to set up permissions in MySQL:<\/p><ol class=\"wp-block-list\">\n<li>Open the MySQL terminal as the root user:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo mysql -u root -p<\/pre><ol class=\"wp-block-list\" start=\"2\">\n<li>Enter the root password that was set up during the previous step.<\/li>\n\n\n\n<li>Check the authentication method used by MySQL users by running this <a href=\"\/uk\/tutorials\/what-is-a-query\">database query<\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">SELECT user, authentication_string, plugin FROM mysql.user;<\/pre><ol class=\"wp-block-list\" start=\"4\">\n<li>It displays the current authentication method for all added users:<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab32110c\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"239\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/mysql-shell-auth-socket-highlighted-1024x239.png\" alt=\"Checking authentication method for MySQL users\" class=\"wp-image-109251\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted-1024x239.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted-300x70.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted-150x35.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted-768x179.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted-1536x358.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-auth-socket-highlighted.png 1680w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>If the root user is using the <strong>auth_socket<\/strong> plugin, switch it to <strong>caching_sha2_password<\/strong> to enable password-based authentication. Replace <strong>your_new_password<\/strong> with a strong password of your choice:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'your_new_password';<\/pre><ol class=\"wp-block-list\" start=\"6\">\n<li>Verify the changes by rechecking the authentication method:<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab323bd5\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"240\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-1024x240.png\" alt=\"Rechecking authentication method for MySQL users after changes\" class=\"wp-image-109252\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-1024x240.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-300x70.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-150x35.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-768x180.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted-1536x360.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/mysql-shell-caching-sha2-password-highlighted.png 1682w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"7\">\n<li>After validating the authentication method, exit the MySQL session:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">EXIT;<\/pre><h3 class=\"wp-block-heading\" id=\"h-3-access-phpmyadmin-on-a-browser\">3. Access phpMyAdmin on a Browser<\/h3><p>With phpMyAdmin installed and user permissions configured, you&rsquo;re now ready to access the phpMyAdmin interface through your web browser. Follow these steps to connect:<\/p><ol class=\"wp-block-list\">\n<li>Open your web browser.<\/li>\n\n\n\n<li>Type the following URL into your browser&rsquo;s address bar, replacing <strong>your_server_ip<\/strong> with your Ubuntu server&rsquo;s IP address:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">http:\/\/your_server_ip\/phpmyadmin<\/pre><ol class=\"wp-block-list\" start=\"3\">\n<li>Alternatively, if you&rsquo;ve <a href=\"\/uk\/tutorials\/dns\/how-to-point-domain-to-vps\">connected a domain name to your VPS<\/a>, append <strong>\/phpmyadmin<\/strong> to your domain name, for example, <strong>mydomain.com\/phpmyadmin<\/strong>.<\/li>\n\n\n\n<li>You&rsquo;ll be greeted by the phpMyAdmin login page. Log in with the username and password for the MySQL user account you configured earlier.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab32682b\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1009\" height=\"1024\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-login-1009x1024.png\" alt=\"Accessing the phpMyAdmin login page\" class=\"wp-image-109253\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-1009x1024.png 1009w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-296x300.png 296w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-148x150.png 148w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-768x779.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login.png 1090w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Once logged in, you can start managing MySQL databases through the phpMyAdmin dashboard.<\/li>\n\n\n\n<li>When you have completed your database management tasks, exit phpMyAdmin by clicking the <strong>Log out<\/strong> button in the top left corner.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab3290a4\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"590\" height=\"650\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-log-out-highlighted.png\" alt=\"Logging out from phpMyAdmin\" class=\"wp-image-109254\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-log-out-highlighted.png 590w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-log-out-highlighted-272x300.png 272w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-log-out-highlighted-136x150.png 136w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Congratulations, you&rsquo;ve successfully installed phpMyAdmin on your Ubuntu VPS. However, we recommend implementing additional <a href=\"\/uk\/tutorials\/vps-security\">VPS security measures<\/a> in subsequent steps to protect your databases from unauthorized access.<\/p><h3 class=\"wp-block-heading\" id=\"h-4-create-a-new-phpmyadmin-user-optional\">4. Create a New phpMyAdmin User (Optional)<\/h3><p><a href=\"\/uk\/tutorials\/mysql\/how-create-mysql-user-and-grant-permissions-command-line\">Creating a dedicated database user<\/a> enhances security and management flexibility. This is beneficial when multiple people need to access the database but should have different levels of permissions.<\/p><p>For instance, a web developer may require broader database privileges than a content manager. Therefore, setting up specific users for specific roles can minimize potential security risks.<\/p><p><strong>Using the Command-Line Operation<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Start by accessing your MySQL database server. Enter the root password when prompted:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo mysql -u root -p<\/pre><ol class=\"wp-block-list\" start=\"2\">\n<li>Execute this query to create a new user. Replace <strong>newuser<\/strong> and <strong>password<\/strong> with your desired credentials:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';<\/pre><ol class=\"wp-block-list\" start=\"3\">\n<li>Assign permissions to the new user. For example, to grant all privileges on a database named <strong>newdatabase<\/strong>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">GRANT ALL PRIVILEGES ON newdatabase.* TO 'newuser'@'localhost';<\/pre><ol class=\"wp-block-list\" start=\"4\">\n<li>Make sure the new settings take effect:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">FLUSH PRIVILEGES;<\/pre><ol class=\"wp-block-list\" start=\"5\">\n<li>Exit the MySQL shell:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">EXIT;<\/pre><p><strong>Using phpMyAdmin&rsquo;s Graphical Interface<\/strong><\/p><ol class=\"wp-block-list\">\n<li>Log in to your phpMyAdmin dashboard through your web browser.<\/li>\n\n\n\n<li>Go to <strong>User accounts<\/strong> &rarr; <strong>Add user account<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab32befd\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"556\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-1024x556.png\" alt=\"Accessing the Add user account option on phpMyAdmin\" class=\"wp-image-109255\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-1024x556.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-300x163.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-150x81.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-768x417.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-1536x834.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-user-accounts-add-user-account-highlighted-2048x1112.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Fill in the user details, including the username, hostname, and password.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab32ea49\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"475\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-add-user-account-1024x475.png\" alt=\"Adding a new user account on phpMyAdmin\" class=\"wp-image-109256\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-1024x475.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-300x139.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-150x70.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-768x356.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-1536x712.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-add-user-account-2048x950.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"4\">\n<li>Scroll down to set the privileges for the new user. You can choose either global or specific privileges for certain databases.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab3314bc\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"530\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-global-privileges-selected-1024x530.png\" alt=\"Granting global privileges for the new user\" class=\"wp-image-109257\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-1024x530.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-300x155.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-150x78.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-768x398.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-1536x796.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-global-privileges-selected-2048x1061.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Click <strong>Go<\/strong> at the bottom of the page to create the user account.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-5-set-up-an-additional-login-gateway-optional\">5. Set Up an Additional Login Gateway (Optional)<\/h3><p>Implement an additional login gateway to make your server more secure. This prevents unauthorized access and secures sensitive information, especially important if your database contains critical or personal data.<\/p><p>Follow this guide to set up a login gateway for phpMyAdmin:<\/p><ol class=\"wp-block-list\">\n<li>Use the <a href=\"\/uk\/tutorials\/how-to-install-and-use-nano-text-editor\">nano text editor<\/a> to open the phpMyAdmin Apache configuration file:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo nano \/etc\/apache2\/conf-available\/phpmyadmin.conf<\/pre><ol class=\"wp-block-list\" start=\"2\">\n<li>Within the <strong>&lt;Directory \/usr\/share\/phpmyadmin&gt;<\/strong> section, add the <strong>AllowOverride All<\/strong> directive:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">&lt;Directory \/usr\/share\/phpmyadmin&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Options SymLinksIfOwnerMatch<br><br>&nbsp;&nbsp;&nbsp;&nbsp;DirectoryIndex index.php<br><br>&nbsp;&nbsp;&nbsp;&nbsp;AllowOverride All<br><br>&nbsp;&nbsp;&nbsp;&nbsp;. . .<\/pre><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab334223\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"318\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/nano-editor-allow-overides-all-highlighted-1024x318.png\" alt=\"Editing the phpmyadmin.conf file on the nano text editor\" class=\"wp-image-109258\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-1024x318.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-300x93.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-150x47.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-768x238.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-1536x477.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/nano-editor-allow-overides-all-highlighted-2048x636.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Save the changes and exit the editor by pressing <strong>Ctrl + X &rarr; Y &rarr; Enter<\/strong>.<\/li>\n\n\n\n<li>Restart the Apache service to apply these updates:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo systemctl restart apache2<\/pre><ol class=\"wp-block-list\" start=\"5\">\n<li>Navigate to the phpMyAdmin directory and create a new <strong>.htaccess<\/strong> file:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo nano \/usr\/share\/phpmyadmin\/.htaccess<\/pre><ol class=\"wp-block-list\" start=\"6\">\n<li>Enter the following directives in this file. These settings configure basic authentication, set a generic message for the login prompt, specify the password file&rsquo;s location, and restrict access to authenticated users only:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">AuthType Basic<br><br>AuthName \"Restricted Files\"<br><br>AuthUserFile \/etc\/phpmyadmin\/.htpasswd<br><br>Require valid-user<\/pre><ol class=\"wp-block-list\" start=\"7\">\n<li>Once done, save and close the file.<\/li>\n\n\n\n<li>Create the password file with hashed passwords for authentication. Start with the root user:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo htpasswd -c \/etc\/phpmyadmin\/.htpasswd root<\/pre><ol class=\"wp-block-list\" start=\"9\">\n<li>You&rsquo;ll be prompted to set and confirm a password. To add more users, use the command without the <strong>-c<\/strong> flag:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">sudo htpasswd \/etc\/phpmyadmin\/.htpasswd newuser<\/pre><ol class=\"wp-block-list\" start=\"10\">\n<li>To ensure all your new settings are active, restart Apache again using the same <strong>systemctl restart<\/strong> command.<\/li>\n\n\n\n<li>Access phpMyAdmin in your browser, and you&rsquo;ll need to enter the username and password you just configured:<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"69e1dab3372e4\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"374\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/05\/phpmyadmin-login-authentication-1024x374.png\" alt=\"the phpMyAdmin login page with additional authentication\" class=\"wp-image-109259\" srcset=\"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication-1024x374.png 1024w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication-300x110.png 300w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication-150x55.png 150w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication-768x281.png 768w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication-1536x561.png 1536w, https:\/\/www.hostinger.com\/uk\/tutorials\/wp-content\/uploads\/sites\/51\/2024\/05\/phpmyadmin-login-authentication.png 1800w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Throughout this guide, we&rsquo;ve covered the instructions for installing and configuring phpMyAdmin on your Ubuntu server:<\/p><ol class=\"wp-block-list\">\n<li>Download and install phpMyAdmin from the package repository.<\/li>\n\n\n\n<li>Set up secure MySQL user accounts.<\/li>\n\n\n\n<li>Log in to phpMyAdmin via a web browser.<\/li>\n\n\n\n<li>Configure additional user accounts and custom permissions.<\/li>\n\n\n\n<li>Add <strong>.htaccess<\/strong> authentication to strengthen security.<\/li>\n<\/ol><p>By following these steps, you ensure a robust environment for managing MySQL databases. Remember, maintaining a secure database system is crucial for database administrators and developers.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-install-phpmyadmin-on-ubuntu-faq\">How to Install phpMyAdmin on Ubuntu FAQ<\/h2><p>This section answers the most common questions about installing phpMyAdmin on Ubuntu.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1715174943647\"><h3 class=\"schema-faq-question\">Is phpMyAdmin Secure?<\/h3> <p class=\"schema-faq-answer\">phpMyAdmin is secure when properly configured. It offers features like brute-force attack prevention and user access controls. To make your web server&rsquo;s configurations more secure, use strong passwords and regularly update phpMyAdmin.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1715174949550\"><h3 class=\"schema-faq-question\">What Should I Do if I Forgot My MySQL Root Password?<\/h3> <p class=\"schema-faq-answer\">If you forget your MySQL root password, you can reset it by stopping the MySQL service and starting it with the <strong>&ndash;skip-grant-tables<\/strong> option to enable password-less access. Then, log in as root and set a new password. Finally, restart MySQL and log in to the database using your new password.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1715174959895\"><h3 class=\"schema-faq-question\">Why Can&rsquo;t I Access phpMyAdmin After Installation?<\/h3> <p class=\"schema-faq-answer\">If you can&rsquo;t access phpMyAdmin after installation, check if Apache and PHP are correctly configured and running. Make sure <strong>phpmyadmin.conf<\/strong> is included in Apache&rsquo;s configuration and that all required PHP extensions are installed. Also, make sure your MySQL service is active.<\/p> <\/div> <\/div><h3 class=\"wp-block-heading\" id=\"h-\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>phpMyAdmin is a popular administrative tool for managing MariaDB and MySQL databases through a user-friendly web interface. It lets you execute database administration tasks such as running queries, managing users and permissions, and exporting and importing databases. Setting up phpMyAdmin on a Linux-based virtual private server (VPS) allows for efficient and secure remote database management. [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/uk\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":102,"featured_media":24091,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Install phpMyAdmin on Ubuntu","rank_math_description":"Learn how to install phpMyAdmin on Ubuntu: 1. Install the phpMyAdmin package 2. Set up user permissions 3. Access phpMyAdmin via browser + more.","rank_math_focus_keyword":"how to install phpmyadmin on ubuntu","footnotes":""},"categories":[22646,22640],"tags":[],"class_list":["post-15996","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-control-panels","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/installer-phpmyadmin-sur-ubuntu","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-install-phpmyadmin-ubuntu","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-and-setup-phpmyadmin-on-ubuntu","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/comments?post=15996"}],"version-history":[{"count":27,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15996\/revisions"}],"predecessor-version":[{"id":112026,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/posts\/15996\/revisions\/112026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media\/24091"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/media?parent=15996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/categories?post=15996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/uk\/tutorials\/wp-json\/wp\/v2\/tags?post=15996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}