Installing Adminer for Efficient MySQL Management on Alma Linux

Adminer, formerly known as phpMinAdmin, is a comprehensive database management tool developed in PHP. It enables you to manage a variety of databases, including MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB, and many others. Its simplicity, lightweight design, robust security features, and enhanced user experience make it an excellent choice for database administration.

This guide will walk you through the process of installing Adminer on AlmaLinux 8.

Prerequisites

  • A server running AlmaLinux 8.
  • A valid domain name linked to your server’s IP.
  • The root password configured on the server.

Install LAMP Server

First, we need to set up the Apache web server, MariaDB database server, and PHP on your server. Execute the following command to install these components:

dnf install httpd mariadb-server php php-mysqli php-curl php-json -y

Once installed, start and enable both Apache and MariaDB services using:

systemctl start httpd mariadb
systemctl enable httpd mariadb

These steps will ensure that the services are up and running. Proceed to the next section when ready.

Create a Database for Adminer

Next, you’ll need to create a database and an associated user for Adminer. Access the MariaDB shell by running:

mysql

Within the MariaDB shell, execute the following commands to set up the database and user:

MariaDB [(none)]> CREATE DATABASE adminer;
MariaDB [(none)]> CREATE USER 'adminer'@'localhost' IDENTIFIED BY 'password';

Grant full privileges to the new Adminer database with:

MariaDB [(none)]> GRANT ALL ON adminer.* TO 'adminer'@'localhost';

Finally, refresh the privileges and exit the MariaDB shell:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Download Adminer

Download the latest Adminer version to your server. Start by creating a directory for Adminer within the Apache web root:

mkdir /var/www/html/adminer

Navigate to the newly created directory and download Adminer with:

cd /var/www/html/adminer
wget -O index.php https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php

After downloading, set the appropriate ownership and permissions for the Adminer directory:

chown -R apache:apache /var/www/html/adminer/
chmod -R 775 /var/www/html/adminer/

Now, progress to configuring Apache.

Configure Apache for Adminer

nano /etc/httpd/conf.d/adminer.conf

Add the following VirtualHost configuration for Adminer:

<VirtualHost *:80>
     ServerAdmin admin@exampledomain.com
     DocumentRoot /var/www/html/adminer/
     ServerName adminer.exampledomain.com
     DirectoryIndex index.php
     ErrorLog /var/log/httpd/adminer-error.log
     CustomLog /var/log/httpd/adminer-access.log combined
</VirtualHost>

After saving the file, restart Apache to reflect these changes:

systemctl restart httpd

You can verify if Apache is running smoothly with:

systemctl status httpd

You should see output indicating Apache is active and running, which means your setup is successful. Now, move to access Adminer’s web interface.

Access Adminer Web Interface

Launch your web browser and open Adminer’s interface using http://adminer.exampledomain.com. You’ll encounter the following login page:

Adminer Login

Enter your MySQL or MariaDB host address, database name, username, and password, then click Login. Upon successful login, you will see the following Adminer dashboard:

Adminer dashboard

The dashboard enables you to perform various database operations like creating tables, views, procedures, and moreā€”all through your web browser.

Conclusion

Congratulations! You’ve successfully installed Adminer on AlmaLinux 8. You can now add and manage remote database servers via this central location. Feel free to reach out if you have any questions.

Frequently Asked Questions (FAQ)

  • What versions of databases can Adminer manage?Adminer can manage MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB, and more.
  • Is Adminer secure to use?Yes, Adminer is designed with strong security measures and a focus on user experience.
  • Can I use Adminer to manage databases remotely?Yes, once configured, Adminer allows you to manage remote databases from a central interface.
  • How do I update Adminer when a new version is released?To update Adminer, download the latest version from the official repository and replace the existing index.php file in your Adminer directory.
  • What should I do if I encounter issues during installation?Double-check all configurations and commands executed. Ensure your domain is correctly pointing to the server IP and all required packages and services are running.