How to reinstall phpMyAdmin on Ubuntu 16.04
- sudo apt install wget -y
- wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.
(the -P option instructs wget to save the files directly in the Downloads directory. Feel free to specify any directory you see fit)
- To verify the GPG key for phpMyAdmin, download the phpMyAdmin keyring to the Downloads directory:
wget -P Downloads https://files.phpmyadmin.net/phpmyadmin.keyring
- Access the Downloads directory and import the keyring:
- cd Downloads
- gpg --import phpmyadmin.keyring
- Download the corresponding GPG .asc file for your version of phpMyAdmin:
wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
- Access the Downloads directory and verify the .asc file against the keyring you downloaded:
cd Downloads
gpg --verify phpMyAdmin-latest-all-languages.tar.gz.asc
- Create a phpMyAdmin directory in the Apache web root directory:
sudo mkdir /var/www/html/phpMyAdmin
- Access the Downloads directory and unpack the phpMyAdmin tar.gz files to the newly created directory:
cd Downloads
sudo tar xvf phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin
- Create a default configuration file:
sudo cp /var/www/html/phpmyadmin/config.sample.inc.php /var/www/html/phpmyadmin/config.inc.php
- Use the nano text editor (or your preferred text editor), to add a secret passphrase to the config.inc.php file:
sudo nano /var/www/html/phpmyadmin/config.inc.php
- Locate the following line:
['blowfish_secret'] = '';
- Add a secret passphrase as follows:
['blowfish_secret'] = 'my_secret_passphrase';
Use a complex passphrase of your choice and then exit and save the file (Ctrl+x).
- Change the permissions for the config.inc.phpfile:
sudo chmod 660 /var/www/html/phpmyadmin/config.inc.php
- Change ownership of the phpMyAdmin directory:
sudo chown –R www-data:www-data /var/www/html/phpmyadmin
- Restart Apache:
sudo systemctl restart apache2
- Use your preferred web browser and navigate to the following web address:
localhost/phpmyadmin
The system prompts the phpMyAdmin login screen and establishes a connection to the local Apache, MariaDB, and PHP files that you have created.
- Log in to phpMyAdmin with the username and password for the MariaDB user you created and granted privileges to. Take your time and explore the many options and settings phpMyAdmin has to offer.