Skip to main content

Create phpmyadmin local instance

wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip -O phpmyadmin.zip

unzip phpmyadmin.zip && rm phpmyadmin.zip

mv phpmyadmin/phpMyAdmin-* phpmyadmin

chmod -R 0755 phpmyadmin

mkdir phpmyadmin/tmp

vim /etc/apache2/conf-available/phpmyadmin.conf

Put the following content in the configuration file. Replace /usr/share/ with your selected document root:

# phpMyAdmin Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
    Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/libraries>
    Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Require all denied
</Directory>

 

sudo a2enconf phpmyadmin && sudo systemctl reload apache2

 

Things to check or do:

  1. File permissions on tmp dir
  2. For local devsystems - NOT IN PRODUCTION:

mysql -u root -proot -e "alter user 'root'@'localhost' identified with mysql_native_password by 'PASSWORT'"