Report this

What is the reason for this report?

How To Install phpMyAdmin on a LEMP server

Updated on January 19, 2021
How To Install phpMyAdmin on a LEMP server

About phpMyAdmin

phpMyAdmin is a free software to work with MySQL on the web—it provides a convenient visual front end to the capabilities of MySQL.

Setup

Prior to installing phpMyAdmin, be sure that you have LEMP installed on your VPS. If you do not, you can see how to do that here.

Once you have finished installing LEMP on your virtual private server, you can start on installing phpMyAdmin.

Step One—Install phpMyAdmin

Start off by downloading the program from apt-get.

sudo apt-get install phpmyadmin

During the installation, phpmyadmin will ask you if you want to configure the database with dbconfig. Go ahead and choose yes.

Input MySQL’s database password when prompted and click ok.

When phpmyadmin prompts you to choose a server (either apache or lighttpd) hit tab, and select neither one.

Step Two—Configure phpMyAdmin

You now have phpMyAdmin installed on your server. In order to access it, you need to take one more step.

Create a symbolic link between phpMyAdmin and your site’s directory. If you were using the previous tutorial, it may be still located in the nginx default directory, otherwise link it with the appropriate place:

sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www

Restart nginx:

sudo service nginx restart

You should now be able to access phpMyAdmin by going to yourdomain/phpmyadmin. The screen will look like this.

Log in with your MySQL username and password.

By Etel Sverdlov

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Etel Sverdlov
Etel Sverdlov
Author
See author profile

Former Director of Community at DigitalOcean. Expert in cloud topics including LAMP Stack, CentOS, Ubuntu, MySQL, SSL certificates, and more.

Category:

Still looking for an answer?

Was this helpful?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

I have this error: The mysqli extension is missing.

What’s wrong?

Fixed it by commenting this line on php.ini

mysqli.allow_local_infile = On

I followed this tutorial step by step but I really don’t want the folder phpmyadmin inside the www Can I do this sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx and delete the folder that’s inside www?

That’s fine. The key is just to link it to your site’s document root, wherever it is located.

I don’t want phpmyadmin inside www either but i’m not a linux power user. If i do what narobycaronte suggests above, my 2 questios are: 1 - How can i delete the folder inside www? 2 - How can i access to phpmyadmin in the new location? Thank you so much in advance.

I followed all the steps but when i try to access phpmyadmin it doesn,t show up. What i get is my wordpress home page.

http://192.81.215.199/phpmyadmin/ = http://192.81.215.199

Any idea?

Thank you.

Hi,

Before i install varnish, the phpmyadmin work just fine, but now i cannot access my PMA

My Safari shows error cannot connect to the server and the address bar show this URL: http://www.mydomain.com:8080/phpmyadmin/index.php?lang=en&token=ee32cac842265b6073b35abbc5f9febb&phpMyAdmin=s6f1srdnh4csbfdq7lacn7lk5p8cof7d

Hello, I came here from https://www.digitalocean.com/community/articles/how-to-install-wordpress-nginx-php-and-varnish-on-ubuntu-12-04

I have totally same problem with @dzulfriday

Could you please help us ?

Got this error after completing the installation:

phpMyAdmin: Cannot load mcrypt extension. Please check your PHP configuration

@eticonleong You have to install the php mcrypt extension: sudo apt-get install php5-mcrypt

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.