Linux Tactic

A Complete Guide to Installing and Configuring phpMyAdmin on Ubuntu

Installing PhpMyAdmin on Ubuntu: A Comprehensive Walkthrough

Are you looking for a way to install phpMyAdmin on your Ubuntu server? Look no further than this comprehensive guide.

In this article, we’ll provide step-by-step instructions on how to install phpMyAdmin, as well as how to configure it with Nginx. Our guide includes all the prerequisites, installation steps, and configuration methods you’ll need to get up and running with this versatile database management tool.

Prerequisites

Before we begin, make sure you have the following tools installed on your Ubuntu 18.04 server. – PHP

– MySQL or MariaDB

– Nginx

– Let’s Encrypt SSL

Installation

Step 1. First, update your package repositories with the following command:

sudo apt update

Step 2. Install phpMyAdmin using the following command:

sudo apt install phpmyadmin

Step 3. During the installation process, you will be prompted to configure a database for phpMyAdmin using dbconfig-common.

Enter your database information, including your root password. Step 4.

Once the installation is complete, you will need to configure phpMyAdmin to work with your Nginx server.

Administrative MySQL User

By default, phpMyAdmin uses the “mysql_native_password” authentication method. However, Ubuntu 18.04 has updated the MySQL version, so you may need to change the authentication method.

To set up an administrative MySQL user, follow these steps:

Step 1. Log in to your MySQL server as the root user:

sudo mysql -u root -p

Step 2. Create a new user by running the following command:

CREATE USER ‘phpmyadmin’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘your_password’;

Note: Be sure to replace “your_password” with a strong password of your choice.

Step 3. Grant privileges to the new user:

GRANT ALL PRIVILEGES ON *.* TO ‘phpmyadmin’@’localhost’;

Step 4.

Exit MySQL:

FLUSH PRIVILEGES;

EXIT;

Configuration Methods

Now that you’ve installed phpMyAdmin and set up your MySQL user, it’s time to configure Nginx to work with phpMyAdmin. There are two methods you can use to configure Nginx: symbolic links and server blocks.

Symbolic Links

To use symbolic links, create a symbolic link in your Nginx configuration directory that points to your phpMyAdmin installation’s configuration file. Here’s how:

Step 1.

Create the symbolic link:

sudo ln -s /etc/phpmyadmin/nginx-phpmyadmin.conf /etc/nginx/conf.d/

Step 2. Restart Nginx:

sudo systemctl restart nginx

Server Blocks

To use server blocks, create a new server block file and add the following code:

server {

listen 80;

server_name domain.com;

location /phpmyadmin {

alias /usr/share/phpmyadmin/;

index index.php;

}

location ~ .php$ {

include snippets/fastcgi-php.conf;

fastcgi_pass unix:/run/php/php7.4-fpm.sock;

}

}

Creating a Snippet

If you prefer to use snippets, you can create a new server block file and use an include statement to include the snippet. Here’s how:

Step 1.

Create the snippet:

location /phpmyadmin {

alias /usr/share/phpmyadmin/;

index index.php;

}

Step 2. Include the snippet in your server block:

server {

listen 80;

server_name domain.com;

include snippets/phpmyadmin.conf;

location ~ .php$ {

include snippets/fastcgi-php.conf;

fastcgi_pass unix:/run/php/php7.4-fpm.sock;

}

}

Conclusion

By following this guide, you can quickly and easily install and configure phpMyAdmin on your Ubuntu 18.04 server. With the ability to manage your databases in a user-friendly interface, you’ll find that this versatile tool is a valuable addition to your web development toolkit.

Accessing phpMyAdmin: A Step-by-Step Guide

Now that you’ve successfully installed and configured phpMyAdmin on your Ubuntu server, you’re ready to start managing your databases. In this article, we’ll guide you through the process of accessing phpMyAdmin, including how to log in and navigate the dashboard.

Accessing Interface

To access phpMyAdmin, you will need to use a web browser to connect to your server’s domain name or public IP address. Here’s how:

Step 1.

Open your preferred web browser. Step 2.

Enter your server’s domain name or public IP address in the address bar. Note: If you’re using a domain name, make sure that the DNS records are set up correctly to point to your server’s IP address.

Step 3. Type “/phpmyadmin” at the end of the URL, like this: “yourdomain.com/phpmyadmin”.

Step 4. Hit enter, and you will be directed to phpMyAdmin’s login screen.

Step 5. Enter your login credentials, including your username and password.

This would be the same as the MySQL user credentials you have previously set up during the installation of phpMyAdmin. Step 6.

Once you have entered your credentials, click on the “Go” button. You should now be logged in to the phpMyAdmin dashboard.

phpMyAdmin Dashboard

The phpMyAdmin dashboard provides a convenient interface for managing your MySQL databases. Here’s a rundown of the various features and functions available:

MySQL Databases: This section allows you to view all of your MySQL databases.

You can add or delete a database by clicking on the “New” or “Drop” buttons. Users: This section lets you manage MySQL users.

Here, you can add or delete a user, set user privileges, and change a user’s password. Tables: This section provides a view of all the tables in a particular database.

You can add or delete tables by clicking on the “New” or “Drop” buttons. Queries: This section allows you to run SQL queries and view their results.

You can enter your query statement in the “SQL” box and click on the “Go” button to execute the query. Operations: This section lets you perform various operations on your MySQL databases, such as renaming a table and optimizing a database.

In summary, phpMyAdmin is a powerful tool that allows you to manage and manipulate MySQL databases with ease. Whether you’re creating, deleting, or updating tables, running SQL queries, or managing user privileges, phpMyAdmin provides a user-friendly interface that makes it easy to manage your MySQL databases.

By following the instructions outlined in this guide, you can access phpMyAdmin and start using it to manage your server’s databases in no time. In conclusion, this article provided a comprehensive guide on installing and configuring phpMyAdmin on your Ubuntu server.

We covered the essential prerequisites, installation steps, and configuration methods you need to manage your MySQL databases. We also discussed how to access phpMyAdmin through a web browser and provided an overview of its dashboard, which lets you perform various database management functions.

By following this guide, you can easily set up and use phpMyAdmin to manage your MySQL databases in a user-friendly interface. It is an essential tool that will streamline your database management tasks, be it creating, deleting, or updating tables, running SQL queries, or managing user privileges.

With this knowledge, you can optimize your database operations and enhance your web development workflow.

Popular Posts