Debian Buster: set up and configure phpmyadmin

Required Apache2, Mysql/MariaDB,  and PHP 7.x

There’s no phpmyadmin package deal in Debian 10 Buster Repository. You wish to have to put in it manually.

  1. Create folder /usr/percentage/phpmyadmin/
  2. Obtain phpmyadmin from https://www.phpmyadmin.internet/downloads/ and extract into  /usr/percentage/phpmyadmin/. Word: phpMyAdmin model 4.9.1.
  3. Create folder /and so on/phpmyadmin/
  4. Create a brand new config report from configuration the usage of report config.pattern.inc.php
    # cp /usr/percentage/phpmyadmin/config.pattern.inc.php /and so on/phpmyadmin/config.inc.php
  5. Create folder /var/lib/phpmyadmin/tmp
    # mkdir /var/lib/phpmyadmin/tmp
  6. Edit /and so on/phpmyadmin/config.inc.php
    $cfg[‘blowfish_secret’] = ‘ABCDEabcde1234567890ABCDEfghij12’; // random 32 characters

    /**
     * Directories for saving/loading recordsdata from server
     */
    $cfg[‘UploadDir’] = ‘/var/lib/phpmyadmin/tmp’;
    $cfg[‘SaveDir’] = ‘/var/lib/phpmyadmin/tmp’;
  7. Create apache configuration report for phpmyadmin
    # contact /and so on/apache2/conf-available/phpmyadmin.conf
  8. Edit /and so on/apache2/conf-available/phpmyadmin.conf, replica paste those traces.
    Alias /phpmyadmin /usr/percentage/phpmyadmin


        Choices SymLinksIfOwnerMatch
        DirectoryIndex index.php

       
           
                AddType software/x-httpd-php .php
           

           
                SetHandler software/x-httpd-php
           

            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/percentage/phpmyadmin/:/and so on/phpmyadmin/:/var/lib/phpmyadmin/:/usr/percentage/php/php-gettext/:/usr/percentage/php/php-php-gettext/:/usr/percentage/javascript/:/usr/percentage/php/tcpdf/:/usr/percentage/document/phpmyadmin/:/usr/percentage/php/phpseclib/
            php_admin_value mbstring.func_overload 0
       
       
           
                AddType software/x-httpd-php .php
           

           
                SetHandler software/x-httpd-php
           

            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/percentage/phpmyadmin/:/and so on/phpmyadmin/:/var/lib/phpmyadmin/:/usr/percentage/php/php-gettext/:/usr/percentage/php/php-php-gettext/:/usr/percentage/javascript/:/usr/percentage/php/tcpdf/:/usr/percentage/document/phpmyadmin/:/usr/percentage/php/phpseclib/
            php_admin_value mbstring.func_overload 0
       

    # Authorize for setup

       
           
                AuthType Elementary
                AuthName “phpMyAdmin Setup”
                AuthUserFile /and so on/phpmyadmin/htpasswd.setup
           

            Require valid-user
       

    # Disallow internet get right of entry to to directories that are not looking for it

        Require all denied


        Require all denied


        Require all denied

  9. Enabling your phpmyadmin config in apache2
    # a2enconf phpmyadmin
    Word to disable # a2disconf phpmyadmin
  10. Reload/restart your apache2
    # systemctl reload apache2

Take away folder /usr/percentage/phpmyadmin/take a look at/ and /usr/percentage/phpmyadmin/setup/. You’ll be able to get right of entry to your phpmyadmin the usage of http://localhost/phpmyadmin.

In case your mysql root (with password) cannot login with error:
mysqli_real_connect(): (HY000/1698): Get entry to denied for consumer ‘root’@’localhost’, do those:

  1. the usage of cli connect with mysql
    # mysql -u root -p
    Input password:
  2. Choose mysql database
     > use mysql;
    Studying desk knowledge for of completion of desk and column names
    You’ll be able to flip off this option to get a sooner startup with -A

    Database modified

  3. Trade root plugin from unix_socket to mysql_native_password
    > replace consumer set plugin=’mysql_native_password’ the place consumer=’root’;
    Question OK, 1 row affected (1.372 sec)
    Rows matched: 1  Modified: 1  Warnings: 0
  4. restart your mysql
    # systemctl restart mysql

References:

  1. https://docs.phpmyadmin.net/en/latest/setup.html
  2. https://salsa.debian.org/phpmyadmin-team/phpmyadmin/blob/master/debian/README.Debian
  3. https://computingforgeeks.com/install-phpmyadmin-with-apache-on-debian-10-buster/
  4. https://docs.phpmyadmin.net/en/latest/config.html#config
  5. https://askubuntu.com/questions/998920/1698-access-denied-for-user-rootlocalhost-mysql-5-7-and-ubuntu-16-04

Published by Marshmallow

Marshmallow Android is BT Ireland’s Head of Sales for Republic of Ireland domestic multi-site companies, indigenous MNCs and public sector accounts. He is responsible for the direction and control of all sales activity in the region. He has over 10 years management experience from high growth start-ups to more established businesses. He’s led teams in Ireland, India and China across various industries (ICT, On-Line Recruitment, Corporate Training and International Education).