How To Install Phpmyadmin In Ubuntu 18.04 Nginx
Introduction
The MySQL database management system is one of the most popular and powerful open source database systems available today. To make managing MySQL databases easier, many webmasters install phpMyAdmin – a web-based graphical interface for MySQL administration. This tutorial will show you how to install phpMyAdmin on Ubuntu 18.04 (Nginx) for easy database management on your server.
A common misconception about phpMyAdmin is that it allows remote access to your MySQL databases. This is not true. phpMyAdmin is simply a graphical interface, accessed only through HTTP using a web browser. It does not provide access to the MySQL command line nor does it allow remote access to the MySQL databases.
Prerequisites
Before you begin with this tutorial, please make sure that you have the following:
- An Ubuntu 18.04 Droplet
- A regular, non-root user with administrative privileges
- Nginx installed on your system
- MySQL installed on your system
To learn more about setting up a user with administrative privileges, consult the Initial Server Setup guide for Ubuntu 18.04. If you have not installed MySQL and Nginx yet, check out the MySQL setup guide and the Nginx Setup guide.
Step 1: Install phpMyAdmin
phpMyAdmin is included in the default package repositories for Ubuntu 18.04. You can install it with the standard apt package manager. To do so, update the local package index and then install the phpmyadmin package.
sudo apt update
sudo apt install phpmyadmin
During the install, you’ll be prompted to choose a webserver for use with phpMyAdmin. To use Nginx, select no by pressing the Space key. Afterward, select yes to restart Nginx. Confirm with yes to finish the configuration.
Once phpMyAdmin has been installed, it’s time to make a few changes to the default configuration. First, open phpMyAdmin’s main configuration file using your favorite text editor:
sudo nano /etc/phpmyadmin/config.inc.php
This file allows you to change a few phpMyAdmin settings. The most common change is to update the authentication type so that phpMyAdmin can access MySQL.
Look for the lines that begin with $i
and type Authentication
, ensuring that the value is set to signon
.
It’s also a good idea to change the value of the AllowNoPassword
line so that a password is required to log in to phpMyAdmin. To do so, change the value from true
to false
.
$cfg['Servers'][$i]['AllowNoPassword'] = false;
When you’re finished making these changes, save and exit the configuration file.
Step 2: Configure the Nginx Server Block
Now that phpMyAdmin has been installed, you’ll need to configure your Nginx server block to serve phpMyAdmin.
Create a new server block using your favorite text editor. Replace example.com
with your domain name.
sudo nano /etc/nginx/sites-available/example.com
Add the following lines to the server block configuration, replacing “example.com” and the PATH TO YOUR FILES placeholder with your domain name and the appropriate filepath:
location /phpmyadmin {
root /PATH/TO/YOUR/FILES;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+.php)$ {
root /PATH/TO/YOUR/FILES;
try_files $uri =404;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
When you’re finished editing this file, save and exit.
Once you have the server block set up, you can enable it by creating a symbolic link to the file in the /etc/nginx/sites-enabled
directory. To do this, use the following command (substituting your_domain for your domain name):
sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled
Now that you have an Nginx server block configured for phpMyAdmin, you can test your Nginx configuration files.
sudo nginx -t
If everything is working properly, your output should look like this:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
When you have tested and saved your changes, enable phpMyAdmin by restarting Nginx.
sudo systemctl restart nginx
Step 3: Logging In To phpMyAdmin
At this point, you should now be able to access phpMyAdmin in your web browser by navigating to http://example.com/phpmyadmin. You can also use your server’s IP address if the domain is not yet pointed at the droplet.
You should see a login page. Enter the username and password of the MySQL user you wish to use. After a successful login, you should be able to manage your MySQL databases through a graphical interface.
Conclusion
You have now installed phpMyAdmin on Ubuntu 18.04 and configured it to use Nginx. You should be able to access phpMyAdmin in your web browser.
FAQs
Q. What is phpMyAdmin?
phpMyAdmin is a web-based MySQL management tool. It allows you to easily create, modify, and delete databases, tables, columns, and more. It also allows you to easily export database data into various formats.
Q. Is phpMyAdmin secure?
phpMyAdmin is very secure. All data is encrypted in transit, and it supports strong authentication, limiting access to only those with the appropriate MySQL user credentials.
Q. What other databases does phpMyAdmin support?
phpMyAdmin supports a variety of other databases, including PostgreSQL, SQLite, and Microsoft SQL Server.
Q. Does phpMyAdmin allow remote access?
No, phpMyAdmin does not allow remote access to your databases. It is only accessible through the web interface, which is served only over a local connection.
Thank you for reading this article. Please take a look at our other articles for more tips and tricks for managing MySQL databases.
Related Posts:
- How Use Nginx Mysql Ubuntu How to Use Nginx, MySQL and Ubuntu What is Nginx? Nginx is an open source web server and reverse proxy software written by Igor Sysoev. It is a popular choice…
- How To Install Nginx On Ubuntu 18.04 How To Install Nginx on Ubuntu 18.04 Introduction Nginx is a popular open-source web server and reverse proxy software that’s used by millions of websites. It’s the most widely used…
- Add Root Password Mysql Nginx Ubuntu 16.04 Add Root Password Mysql Nginx Ubuntu 16.04 What is a root password? In the context of computer security, a root password is a user account that is given access to…
- Install Laravel 5.8 Nginx Php7.3 Install Laravel 5.8 Nginx Php7.3 Overview Installing Laravel 5.8 on a Nginx server running PHP 7.3 can be a tricky task. This tutorial explains how to install the popular open…
- Failed To Start Nginx Service In Ubuntu Failed to Start Nginx Service in Ubuntu What is Nginx? Nginx is an open-source web server written in C, designed for high performance and stability. Nginx is one of the…
- Install Nginx Php Raspberry Pi Install Nginx Php Raspberry Pi What Is a Raspberry Pi? The Raspberry Pi is a low-cost, energy-saving device, made primarily for educational purposes. It is a small, single board computer…
- Upload Max Size Nginx Phpmyadmin Upload Max Size Nginx Phpmyadmin What is Nginx? Nginx is an open source web server and reverse proxy created for high performance and scalability. It is used to serve web…
- Ubuntu Install Nginx Php7.2 Mysql Ubuntu Install Nginx Php7.2 Mysql What is Nginx? Nginx is an open source web server that is very popular for powering web applications such as WordPress and Drupal. It is…
- Can I Install Phpmyadmin In Nginx Can I Install Phpmyadmin In Nginx? PHPmyadmin is a web-based management tool for databases such as MySQL and MariaDB. It is a popular tool for web developers and database administrators…
- Nginx Mariadb Php Fpm Debian8 Mariadb Nginx Mariadb Php Fpm Debian8 Mariadb Introduction to the Setup Nginx, MariaDB, and PHP are all popular tools for web development. Nginx is a web server, MariaDB is an open-source…
- Webdav Nginx Ubuntu 16.04 Webdav Nginx Ubuntu 16.04 Introduction to Webdav with Nginx in Ubuntu 16.04 The ever-evolving world of the internet has given us a powerful platform to share information, media, and files…
- Ubuntu 16.04 Nginx-Extras Ubuntu 16.04 Nginx-Extras Introduction to Nginx-Extras on Ubuntu 16.04 Nginx-Extras are a set of extra features for Nginx, such as WebDAV, Secure Token (STS),gzip precompression, and GeoIP. All of these…
- Install Postgis Ubuntu 18.04 Nginx Install Postgis Ubuntu 18.04 Nginx What is Postgis? Postgis is a Postgres-based open source geographic information system (GIS) that enables users to store, query, and analyze spatial data stored in…
- Digital Ocean Ubuntu Server Nginx Docker Digital Ocean Ubuntu Server Nginx Docker Understanding Digital Ocean Digital Ocean is a cloud service provider that focuses on simplifying web infrastructure for cloud developers. They offer a platform where…
- Docker Nginx Php Mysql In Xampp Docker Nginx Php Mysql In Xampp Overview of Docker Nginx Php Mysql in Xampp Docker Nginx Php Mysql in Xampp is a powerful web development platform used for developing complex…
- Php-Fpm Nginx Ubuntu 18.04 PHP-FPM & Nginx on Ubuntu 18.04 Introduction to PHP-FPM PHP-FPM (FastCGI Process Manager) is an implementation of FastCGI, which is a standard protocol for interfacing external applications with web servers.…
- Install Phpmyadmin On Nginx Ubuntu 18.04 Install Phpmyadmin On Nginx Ubuntu 18.04 Introduction PhpMyAdmin is one of the most popular and widely used web-based database management tools available. It is used for administering, managing and maintaining…
- Making Service Like Nginx Mariadb Runs On Boot Making Service Like Nginx Mariadb Runs On Boot Introduction to Services A service is a software application or package that needs to be running in order for other software applications…
- How To Login Phpmyadmin In Nginx Server Ubuntu How To Login Phpmyadmin In Nginx Server Ubuntu What is Nginx & phpMyAdmin Nginx is a web server software that is commonly used on Linux-based systems, though it works on…
- Ubuntu 16 Bind9 Nginx Subdomain Ubuntu 16 Bind9 Nginx Subdomain Overview Ubuntu is a popular Linux-based operating system, often used in web hosting. Bind 9 is a DNS server, commonly used in Ubuntu, that helps…
- Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed What Is Nginx? Nginx is a web server software, similar to Apache, used for serving webpages. It is open source, and is often…
- How To Debian Nginx Php How To Debian Nginx Php Step 1 – Setup Your VPS The first step to setting up your web server is getting your VPS (Virtual Private Server). This is usually…
- Install Php Nginx Ubuntu 12.04 Install Php Nginx Ubuntu 12.04 Introduction Welcome to our guide on How to install PHP, Nginx & MySQL on Ubuntu 12.04 LTS. This guide should work on other Linux VPS…
- Bash Install Nginx On Ubuntu How To Install Nginx On Ubuntu What is Nginx? Nginx is a web server that is gaining popularity in the world of web hosting. Nginx is an open source web…
- Install Nginx Php Mysql Phpmyadmin Centos 7 Install Nginx Php Mysql Phpmyadmin Centos 7 A Brief Overview of Centos 7 Centos 7 is a Linux distribution based on the Redhat Enterprise Linux Server, and is a popular…
- 403 Forbidden Nginx Ubuntu 14.04 403 Forbidden Nginx Ubuntu 14.04 What Is a 403 Forbidden Error? A 403 Forbidden error is an HTTP status code that denotes that a server, upon receiving a request from…
- Install Nginx Phpmyadmin Centos 7 Install Nginx Phpmyadmin Centos 7 What is Nginx? Nginx is a web server that is used in Linux-based operating systems such as Centos 7. It is designed to handle high-traffic…
- Create Domain Using Nginx Virtualmin Title: Create Domain Using Nginx Virtualmin Create Domain Using Nginx Virtualmin What is Nginx Virtualmin? Nginx Virtualmin is an automated website management platform from Virtualmin. It provides a powerful web…
- How To Configure Nginx With Varnish How To Configure Nginx With Varnish Introduction Nginx and Varnish are powerful web server tools used to configure and optimize the delivery of web content. Nginx serves requests while Varnish…
- Linux Nginx Mysql Php Lemp Linux Nginx Mysql Php Lemp What is Linux, Nginx, MySQL, PHP (LEMP)? Linux, Nginx, MySQL, PHP (LEMP) is a software stack combination of Linux, Nginx, MySQL, and PHP, commonly referred…