{"id":5522,"date":"2021-04-02T17:56:11","date_gmt":"2021-04-02T17:56:11","guid":{"rendered":"https:\/\/linuxways.net\/?p=5522"},"modified":"2021-04-02T17:56:11","modified_gmt":"2021-04-02T17:56:11","slug":"install-phpmyadmin-with-apache-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/install-phpmyadmin-with-apache-on-ubuntu-20-04\/","title":{"rendered":"Install phpMyAdmin with Apache on Ubuntu 20.04"},"content":{"rendered":"<p>The native tool for access MySQL or MariaDB databases is the command-line. With a few commands, you can access the database shell and perform a variety of tasks including viewing and creating databases and database users. However, not everyone is a fan of the command-line, and this is where phpMyAdmin is beneficial.<\/p>\n<p>Written in PHP, phpMyAdmin is a wonderful free and open-source tool that provides a front-end web interface to MySQL or MariaDB. It allows users to log in and easily perform database management tasks such as managing databases, users, and permissions to mention a few. and user creation. In this guide, we delve into the installation of phpMyAdmin.<\/p>\n<h2>Prerequisites<\/h2>\n<p>PhpMyAdmin is PHP-driven and runs on the front-end. As such, ensure that you have installed LAMP on Ubuntu 20.04. If you don\u2019t have it already, please head over to our article on <a href=\"https:\/\/linuxways.net\/de\/debian\/how-to-install-linux-apache-mariadb-php-lamp-stack-on-debian-10\/\">How to install LAMP.<\/a><\/p>\n<p>Additionally, ensure that you have configured a sudo user on your instance of Ubuntu 20.04.<\/p>\n<h2><strong>Step 1: Install PhpMyAdmin<\/strong><\/h2>\n<p>Firstly, access your terminal and update your package lists using the command provided.<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"185\" class=\"wp-image-5523\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-530.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-530.png 859w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-530-300x65.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-530-768x165.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><\/p>\n<p>The phpMyAdmin package is available on Ubuntu repositories, therefore, use the APT package manager to install it as follows.<\/p>\n<pre><strong>$ sudo apt install phpmyadmin<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"859\" height=\"365\" class=\"wp-image-5524\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-531.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-531.png 859w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-531-300x127.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-531-768x326.png 768w\" sizes=\"auto, (max-width: 859px) 100vw, 859px\" \/><\/strong><\/p>\n<p>Along the way, you will encounter some prompts. First, choose your preferred web server. Since you already have Apache installed, press the TAB key on the \u2018Apache\u2019 option and hit ENTER.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"473\" class=\"wp-image-5525\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-532.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-532.png 857w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-532-300x166.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-532-768x424.png 768w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/p>\n<p>The phpMyAdmin package requires the installation and configuration of a database before use. Manual configuration is hectic and tedious. Thankfully, the setup provides you an option to configure the database using the dbconfig-common which simplifies the configuration.<\/p>\n<p>Select the \u2018<strong>Yes<\/strong>\u2019 option to tweak the phpMyAdmin database with the dbconfig-common package and hit ENTER.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"853\" height=\"453\" class=\"wp-image-5526\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-533.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-533.png 853w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-533-300x159.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-533-768x408.png 768w\" sizes=\"auto, (max-width: 853px) 100vw, 853px\" \/><\/strong><\/p>\n<p>Thereafter, provide the password for phpMyAdmin.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"450\" class=\"wp-image-5527\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-534.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-534.png 852w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-534-300x158.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-534-768x406.png 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><\/strong><\/p>\n<p>And then confirm it as shown.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"858\" height=\"441\" class=\"wp-image-5528\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-535.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-535.png 858w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-535-300x154.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-535-768x395.png 768w\" sizes=\"auto, (max-width: 858px) 100vw, 858px\" \/><\/strong><\/p>\n<p>The installation will then continue with the installation of the required packages, dependencies and PHP extensions that will be required by phpMyAdmin.<\/p>\n<p>Once the installation is complete, a new database called <strong>phpmyadmin<\/strong> is created with the user <strong>phpmyadmin<\/strong>. If you want to feed your curiosity, proceed and access your database as shown.<\/p>\n<pre><strong>$ sudo mysql -u root -p <\/strong><\/pre>\n<p>To display the existing databases execute the MySQL command as follows.<\/p>\n<pre><strong>&gt; show databases;<\/strong><\/pre>\n<p>Be sure to locate the <strong>phpmyadmin<\/strong> database as seen in the snippet provided.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"853\" height=\"468\" class=\"wp-image-5529\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-536.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-536.png 853w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-536-300x165.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-536-768x421.png 768w\" sizes=\"auto, (max-width: 853px) 100vw, 853px\" \/><\/p>\n<p>Additionally, you can view the privileges assigned to the <strong>phpmyadmin<\/strong> user on the <strong>phpmyadmin<\/strong> database by invoking:<\/p>\n<pre>&gt; <strong>show grants for phpmyadmin@localhost;<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1117\" height=\"225\" class=\"wp-image-5530\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-537.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-537.png 1117w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-537-300x60.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-537-1024x206.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-537-768x155.png 768w\" sizes=\"auto, (max-width: 1117px) 100vw, 1117px\" \/><\/p>\n<h2>Step 2: Verify successful installation of PhpMyAdmin<\/h2>\n<p>To ensure that the installation was successful, run the following command to confirm that the <strong>phpmyadmin.conf <\/strong>configuration file exists.<\/p>\n<pre><strong>$ file \/etc\/apache2\/conf-enabled\/phpmyadmin.conf<\/strong><\/pre>\n<p>The output should appear as follows providing you with the full path to the configuration file and the symbolic link it points to.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"860\" height=\"144\" class=\"wp-image-5531\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-538.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-538.png 860w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-538-300x50.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-538-768x129.png 768w\" sizes=\"auto, (max-width: 860px) 100vw, 860px\" \/><\/strong><\/p>\n<h2><strong>Step 3: Access PhpMyAdmin from a browser<\/strong><\/h2>\n<p>The last step in the installation is to access the phpMyAdmin interface. On your browser, browse the address shown:<\/p>\n<pre><strong>http:\/\/server-ip\/phpmyadmin<\/strong><\/pre>\n<p>The phpMyadmin login page comes to view as shown. Use the root credentials to log in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1188\" height=\"566\" class=\"wp-image-5532\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-539.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-539.png 1188w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-539-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-539-1024x488.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-539-768x366.png 768w\" sizes=\"auto, (max-width: 1188px) 100vw, 1188px\" \/><\/p>\n<p><strong>NOTE:<\/strong><\/p>\n<p>If you encounter an error while logging into phpMyAdmin, follow the steps provided:<\/p>\n<p>First, access the MySQL database as shown:<\/p>\n<pre><strong>$ sudo mysql -u root -p<\/strong><\/pre>\n<p>Thereafter proceed and create a new database user :<\/p>\n<pre><strong>&gt; CREATE USER 'user'@'localhost' IDENTIFIED BY 'your-password;<\/strong><\/pre>\n<p>Next, accord all privileges to the user as shown<\/p>\n<pre><strong>&gt; GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';<\/strong><\/pre>\n<p>Finally, flush privileges and exit the shell.<\/p>\n<pre><strong>&gt; FLUSH PRIVILEGES<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"881\" height=\"269\" class=\"wp-image-5533\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-540.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-540.png 881w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-540-300x92.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-540-768x234.png 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/strong><\/p>\n<p>Once logged in, you will be presented with the phpMyAdmin panel as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1284\" height=\"587\" class=\"wp-image-5534\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-541.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-541.png 1284w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-541-300x137.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-541-1024x468.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/03\/word-image-541-768x351.png 768w\" sizes=\"auto, (max-width: 1284px) 100vw, 1284px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>It\u2019s our hope that this tutorial was insightful and that you can seamlessly install phpMyAdmin on your system.<\/p>","protected":false},"excerpt":{"rendered":"<p>The native tool for access MySQL or MariaDB databases is the command-line. With a few commands, you can access the database shell and perform a variety of tasks&hellip;<\/p>","protected":false},"author":1,"featured_media":5563,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[178,257,100],"class_list":["post-5522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-apache","tag-phpmyadmin","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/5522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=5522"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/5522\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/5563"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=5522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=5522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=5522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}