{"id":162,"date":"2017-09-27T17:15:19","date_gmt":"2017-09-27T17:15:19","guid":{"rendered":"http:\/\/cheapwindowsvps.com\/blog\/?p=162"},"modified":"2025-02-04T09:21:48","modified_gmt":"2025-02-04T09:21:48","slug":"how-to-install-phpmyadmin-on-centos-7","status":"publish","type":"post","link":"https:\/\/cheapwindowsvps.com\/blog\/how-to-install-phpmyadmin-on-centos-7\/","title":{"rendered":"How to Install phpMyAdmin on CentOS 7"},"content":{"rendered":"<p>phpMyAdmin is a very popular tool for administration of relational databases like MySQL and MariaDB. However, it doesn&#8217;t come installed by default. In this article, we&#8217;ll see how to install phpMyAdmin on <a href=\"https:\/\/www.centos.org\/about\/\" target=\"_blank\" rel=\"noopener\">CentOS 7<\/a>.<\/p>\n<h2>Why choose phpMyAdmin over the command line?<\/h2>\n<p>All that phpMyAdmin does can be done over the MySQL command line as well. For instance, if you have a database dump in the form of sql statements, you can simply do this to import all the data:<\/p>\n<blockquote>\n<p>$ mysql &lt; input_file.sql<\/p>\n<\/blockquote>\n<p>Similarly, there are commands for importing from and exporting to a CSV file.<\/p>\n<p>But that&#8217;s the point; in order to use the command line effectively, you need to be well versed in the quirks of the command line, as well as master a few commands and their options related to MySQL administration. This might be fine for system administrators, but for the average developer this sometimes feels like asking too much.<\/p>\n<p>This is where phpMyAdmin helps. It offers a neat and useful graphical interface to do pretty much everything you can imagine with the database. Exporting databases, importing files, modifying tables \u2013 all this is made super-easy by phpMyAdmin.<\/p>\n<h2>Requirements for\u00a0Installing phpMyAdmin on CentOS 7<\/h2>\n<p>This article assumes that you have a CentOS server set up, and that you are logged in as the root user. More specifically, make sure you have the following set up and running:<\/p>\n<blockquote>\n<p>Apache 2.4<br \/>\n PHP version 5.4 or above (it&#8217;s best to use PHP 7 these days)<br \/>\n Database: MySQL 5.4, or MariaDB 5.5<\/p>\n<\/blockquote>\n<p>MariaDB is an open source alternative to MySQL, which was acquired by Oracle recently. So, if you&#8217;re planning to use MariaDB, bear in mind that with time, the incompatibilities between the versions will grow and you&#8217;ll need to stick to one of them. In other words, MariaDB won&#8217;t be a &#8220;drop-in replacement for MySQL&#8221; for too long.<\/p>\n<h2>Installing phpMyAdmin on CentOS 7<\/h2>\n<p>phpMyAdmin is neither installed by default in CentOS 7, nor is it available as a package. If you do # yum install phpMyAdmin at this point, you&#8217;ll get an error.<\/p>\n<p>For this to work, you need to add another repository to your installation. The phpMyAdmin package is available in the EPEL repository (in case you&#8217;re wondering, EPEL stands for Extra Packages for Enterprise Linux). You can add this repository by issuing the following command:<\/p>\n<blockquote>\n<p># yum install epel-release<\/p>\n<\/blockquote>\n<p>Allow it some time to search for the repository and add it to your system.<\/p>\n<p>Congratulations! You now have phpMyAdmin available for installed. To do this, simply run the following command:<\/p>\n<blockquote>\n<p># yum install phpmyadmin<\/p>\n<\/blockquote>\n<p>Once the installation is over, you need to make sure the Apache server plays nicely with the phpMyAdmin installation. To ensure this, you need to edit a configutation file. Here&#8217;s how to do it.<\/p>\n<p>Using your favorite text editor (we use vi in this example, but ed, nano, all will work just fine), open the file \/etc\/httpd\/conf.d\/phpMyAdmin.conf as follows:<\/p>\n<blockquote>\n<p># vi \/etc\/httpd\/conf.d\/phpMyAdmin.conf<\/p>\n<\/blockquote>\n<p>Now find the block which says &#8220;Apache 2.4&#8221; and change it to look like this:<\/p>\n<blockquote>\n<p># Apache 2.4<br \/>\n # Require ip 127.0.0.1<br \/>\n # Require ip ::1<br \/>\n Require all granted<\/p>\n<\/blockquote>\n<p>Note that the lines starting with &#8216;#&#8217; are nothing but comments that are ignored by the Apache server, so in effect it&#8217;s only the last line we&#8217;re interested in.<\/p>\n<p>Once this done, save the file and close it.<\/p>\n<p>Now you need to restart the Apache server for these settings to take effect:<\/p>\n<blockquote>\n<p># systemctl restart httpd.service<\/p>\n<\/blockquote>\n<p>And that&#8217;s it! You now have phpMyAdmin installed and running on your machine.<\/p>\n<h2>Accessing phpMyAdmin on CentOS 7<\/h2>\n<p>By convention, the phpMyAdmin installation is accessible on &#8216;\/phpmyadmin&#8217; on your server IP or domain name. This means that if, for example, your server domain name is http:\/\/server.com, then phpMyAdmin will be available on http:\/\/server.com\/phpmyadmin.<\/p>\n<p>Once done, the phpMyAdmin home screen will open, and you can log in using the credentials you provided during the installation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>phpMyAdmin is a very popular tool for administration of relational databases like MySQL and MariaDB. However, it doesn&#8217;t come installed by default. In this article, we&#8217;ll see how to install phpMyAdmin on CentOS 7. Why choose phpMyAdmin over the command line? All that phpMyAdmin does can be done over the MySQL command line as well. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":2,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}