Tutorial

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 authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
10 Comments


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?

Etel Sverdlov
DigitalOcean Employee
DigitalOcean Employee badge
February 1, 2013

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

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
May 5, 2013

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.