3980c49a34e5418a5a48d6efda8cd3715a091322
By:
mmsa

Ran phpmyadmin installation tutorial but can't access http://my_site/phpmyadmin

December 22, 2016 938 views
WordPress MySQL Ubuntu

I have Ubuntu 16.04 droplet with a one-click install of Wordpress.

I went through this tutorial » How To Install and Secure phpMyAdmin on Ubuntu 16.04 « but still couldn't access phpmyadmin.

There are portions of the initial installation that I may have done improperly, but I can't figure out how to remove and reinstall/reconfigure phpmyadmin.

I tried to remove the installation.

  • I ran:
$ sudo apt-get remove phpmyadmin php-mbstring php-gettext
  • Then I:
$ sudo service apache2 restart
  • Then:
$ sudo apt-get install phpmyadmin php-mbstring php-gettext

But I didn't get the same installation prompts. What I got as a result of the installation was:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  www-browser
The following NEW packages will be installed:
  php-gettext php-mbstring phpmyadmin
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,951 kB of archives.
After this operation, 25.1 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package php-gettext.
(Reading database ... 87430 files and directories currently installed.)
Preparing to unpack .../php-gettext_1.0.11-2build1_all.deb ...
Unpacking php-gettext (1.0.11-2build1) ...
Selecting previously unselected package php-mbstring.
Preparing to unpack .../php-mbstring_1%3a7.0+35ubuntu6_all.deb ...
Unpacking php-mbstring (1:7.0+35ubuntu6) ...
Selecting previously unselected package phpmyadmin.
Preparing to unpack .../phpmyadmin_4%3a4.5.4.1-2ubuntu2_all.deb ...
Unpacking phpmyadmin (4:4.5.4.1-2ubuntu2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up php-gettext (1.0.11-2build1) ...
Setting up php-mbstring (1:7.0+35ubuntu6) ...
Setting up phpmyadmin (4:4.5.4.1-2ubuntu2) ...
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
dbconfig-common: flushing administrative password

I ran:

$ sudo service apache2 restart

Once again and tried to get into http://my_site/phpmyadmin to no avail.
What can I do?

The files all seem to be on the server, just not accessible in the browser.
Thanks for your help.
-Alex

1 Answer
xMudrii December 22, 2016
Accepted Answer

Removing phpmyadmin package will not remove it's configuration. To completely remove phpmyadmin including configuration you need to use purge option:

  • sudo apt-get remove --purge phpmyadmin

Next time you install it, you'll be asked for initial configuration.
However if you want to reconfigure it you don't need to reinstall it. You can use dpkg to force run initial configuration prompt:

  • sudo dpkg-reconfigure phpmyadmin

I don't think it's needed. Some problems could arise and it can be fixed by enabling phpmyadmin explicitly.

  • sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

Above command will create symlink for PMA Apache config from phpmyadmin default directory to apache available directory.
When you do this, you need to enable config.

  • sudo a2enconf phpmyadmin.conf

After enabling configuration, Apache restart is required.

  • sudo systemctl restart apache2

Try once again. And hope it works. =)

Have another answer? Share your knowledge.