phpMyAdmin is a web-based interface for managing MySQL and MariaDB databases. It allows administrators to manage databases, users, and tables via an intuitive web interface. Installing phpMyAdmin on openSUSE and SUSE Linux Enterprise Server (SLES) requires adding necessary repositories and configuring services like Apache and PHP.

Since phpMyAdmin is not included in the default repositories, you need to add an external repository such as SUSE Package Hub for SLES or a specific repository for openSUSE. The installation process will also handle dependencies like php-mysql and Apache, but additional configuration is necessary to ensure web access and security.

This guide provides the necessary steps to install and configure phpMyAdmin on openSUSE and SLES.

Steps to install phpMyAdmin on openSUSE and SUSE Linux Enterprise Server (SLES):

  1. Add the appropriate repository for your system.
    $ sudo zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.2:Update/standard/openSUSE:Leap:15.2:Update.repo
    $ sudo zypper refresh
  2. Enable the SUSE Package Hub repository for SLES.
    $ SUSEConnect -p PackageHub/15.2/x86_64
  3. Install phpMyAdmin using zypper.
    $ sudo zypper install phpMyAdmin
  4. Install Apache and PHP if they are not already installed.
    $ sudo zypper install apache2 php7 php7-mysql
  5. Open the Apache configuration file for phpMyAdmin.
    $ sudo vi /etc/apache2/conf.d/phpMyAdmin.conf
  6. Uncomment the Alias line to set the URL path.
    Alias /phpmyadmin "/usr/share/phpMyAdmin"
  7. Change the Require IP rule to allow access from all IP addresses.
    Require all granted
  8. Ensure that the php_mbstring extension is enabled in your php.ini file.
    extension=php_mbstring
  9. Restart the Apache web server to apply the changes.
    $ sudo systemctl restart apache2
  10. Secure the phpMyAdmin installation by adding password protection.
    $ htpasswd -c /etc/phpMyAdmin/.htpasswd your_username
  11. Edit the phpMyAdmin configuration file to enforce authentication.
    <Directory "/usr/share/phpMyAdmin">
    AuthType Basic
    AuthName "phpMyAdmin"
    AuthUserFile /etc/phpMyAdmin/.htpasswd
    Require valid-user
    </Directory>
  12. Restart Apache to apply the security changes.
    $ sudo systemctl restart apache2
  13. Access phpMyAdmin through your browser by visiting the server’s IP or hostname.
    http://server_ip_or_hostname/phpmyadmin
  14. Enter the MySQL or MariaDB root credentials when prompted to log in.

This guide is tested on openSUSE and SLES:

Version Details
openSUSE Leap 15.2 Supported
openSUSE Tumbleweed Supported
SLES 15.x Requires SUSE Package Hub
Discuss the article:

Comment anonymously. Login not required.