phpMyAdmin is a PHP-based, web-accessible tool for managing MySQL databases through a browser. Before installing it, make sure your server already has a working web stack such as LEMP or LAMP. Without that foundation in place, phpMyAdmin will not install or run properly. Once the web service is ready, you can move on to the phpMyAdmin setup.

Install phpMyAdmin

Start by downloading and installing the package with apt-get:

<table> <thead> <tr> <th>1</th> <th>sudo apt-get install phpmyadmin</th> </tr> </thead> <tbody> <tr> <td></td> <td></td> </tr> </tbody> </table>

During installation, you may be asked whether phpMyAdmin should configure a database automatically. Choose Yes.

You may also see a prompt asking you to select a server, such as Apache or lighttpd. Either option can be selected.

Link phpMyAdmin to the Nginx web directory

Installing the package is not the last step. phpMyAdmin still needs to be made accessible from your website directory. To do that, create a link between the phpMyAdmin installation path and the Nginx web root. If you followed the earlier setup, that location may still be Nginx's default directory.

<table> <thead> <tr> <th>1</th> <th>sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www</th> </tr> </thead> <tbody> <tr> <td></td> <td></td> </tr> </tbody> </table>

After that, restart Nginx:

<table> <thead> <tr> <th>1</th> <th>sudo service nginx restart</th> </tr> </thead> <tbody> <tr> <td></td> <td></td> </tr> </tbody> </table>

You should then be able to open phpMyAdmin in your browser at:

http://xxxxxxxx/phpmyadmin

If the phpMyAdmin page appears blank

Sometimes phpMyAdmin loads as a blank page. If that happens, first enable error reporting in PHP.ini and check whether the issue comes from a configuration mistake.

If the configuration looks correct but the page is still blank, try uninstalling phpMyAdmin and installing it again. This means uninstalling the package rather than simply deleting its folder. During that process, restart the Nginx service as needed.

One more detail matters here: when exposing phpMyAdmin through Nginx, it is better to create the link with the ln command in the step above instead of copying the phpMyAdmin directory directly into the Nginx site folder.