Traditionally, users typically connect to a database server’s console and run queries and commands to manage databases, users’ permissions, and other tasks. However, for those not comfortable using the command line interface to manage databases, the phpMyAdmin web interface is a great alternative. With phpMyAdmin, you’ll be able to manage MySQL databases, user accounts, and privileges, execute SQL statements, import and export data in a variety of data formats, and much more. To get started with installing phpMyAdmin, continue with the steps below:

How to install Nginx on Ubuntu Linux

phpMyAdmin needs a web server to function, and Nginx HTTP Server is a great open-source server that you can use with phpMyAdmin. To install Nginx on the Ubuntu server, run the commands below. After installing Nginx, the commands below can be used to stop, start and enable Nginx services to always start up with the server boots. To find out if Nginx is installed and running, simply open your web browser and type in the server’s IP or hostname. If you see a similar page as above, Nginx is installed and functioning.

How to install MariaDB on Ubuntu Linux

phpMyAdmin is a tool to manage database servers. For our database server, we’re going to install MariaDB. phpMyAdmin should also work with the MySQL database server, but we’re going to install it here. To install MariaDB run the commands below. After installing MariaDB, the commands below can be used to stop, start and enable the MariaDB service always to start up when the server boots. After that, run the commands below to secure the MariaDB server by creating a root password, disallowing remote root access removing anonymous, and more. When prompted, answer the questions below by following the guide. To verify that MariaDB is installed and running, run the commands below.

How to create a phpMyAdmin user for MariaDB

The latest MariaDB servers come with a root user set to use the auth_socket authentication method by default. The auth_socket plugin authenticates users that connect from the local host through the Unix socket file. This means that you can’t authenticate as a root by providing a password. This can cause issues with some apps that need to connect to the database via root. To fix that, you’ll need to change the default authentication mechanism from auth_socket to mysql_native_password. However, doing so might introduce security risks since root users shouldn’t be used to connect remotely to the database. A recommended method is to create a dedicated user to connect remotely to your database servers. Since you don’t want to connect to the MariaDB database server from phpMyAdmin as the root user, you should probably create a separate account instead of connecting with the root. Run the commands below to log on to the MariaDB server. Then run the SQL commands below to create a new user for phpMyAdmin to use to connect to the database. Then grant the user full access to manage the database server.

How to install PHP-FPM on Ubuntu Linux

PHP is required for phpMyAdmin. PHP packages are added to Ubuntu repositories. However, the versions of the repositories might not be the latest. If you need to install the latest versions, you’ll need to add a third-party PPA repository. To a third-party repository with the latest versions of PHP, run the commands below. At the time of this writing, the latest PHP version is 8.0. Next, run the commands below to install PHP 8.0 and related modules.

How to install phpMyAdmin on Ubuntu Linux

Now that Nginx and PHP are installed the final step is to install phpMyAdmin and configure. To do that, run the commands below When prompted to choose the web server that should be automatically configured to run phpMyAdmin, tap Ok and press ENTER. When prompted again to allow debconfig-common to install a database and configure select Yes and press ENTER. Then type and confirm a password.

Configuring phpMyAdmin for Nginx support

There are several ways to configure phpMyAdmin to work with Nginx. One way is to use an existing domain server block and create a symbolic link to phpMyAdmin installation files. To do that, run the commands below to create a phpMyAdmin snippet that can be used on an existing server block. Then copy and paste the code below into the file and save. Save the file and exit. Finally, include the configuration above in your Nginx server block. If you don’t have an existing domain, then open the Nginx default server block by running the commands below. When the file opens, copy and paste the highlighted line, then save. Restart Nginx After installing phpMyAdmin, open your web browser and browse to the server hostname or IP address followed by /phpmyadmin. Log on with the account you created earlier for phpMyAdmin. That’s it! Conclusion: This post showed you how to install phpMyAdmin on Ubuntu Linux with Nginx support. If you find any error above or have anything to add, please use the comment form below.