phpMyAdmin is a free software to work with MySQL on the web—it provides a convenient visual front end to the capabilities of MySQL.
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.
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.
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.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
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!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
I had to do: sudo ln -s /usr/share/phpmyadmin/ /var/www/html/
instead of sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www
If you are gettting the 404 in yourdomain.com/phpmyadmin, try
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html
and then
sudo service nginx restart
instead of
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www
(This is because the folder “www” was replaced in the newer versions of Nginx through “html”).
For those who changed root folder and want to access domain.com/phpmyadmin.
Step 1: sudo nano /etc/nginx/sites-available/example.com Step 2: Add below line
location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+.php)$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* ^/phpmyadmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } }
Save and exit Step 3: sudo service nginx restart
DONE!!
If you were following the tutorial here: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04 your wordpress website is in /var/www so instead of
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www
use
sudo ln -s /usr/share/phpmyadmin/ /var/www
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.
I followed all the steps but still getting error: 404 Not Found nginx/1.18.0 (Ubuntu)
In step two, since the home directory for NGINX is at /var/www/html/phpmyadmin, that simlink command should be: sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
Use this is you follow the tutorial and get a 404 error when you try to access phpmyadmin in your browser.
Cheers, Somto
Hey,
I’m getting a 404 error after using this guide. I have multiple domain set up on Ubuntu using nginx. The only difference was the following command:
There is a phpmyadmin directory within /var/www/. Do I need to add server block possibly? Since I have multiple domains, each of them has a separate configuration file.
Any suggestions?
getting blank screen when going to mydomain.com/phpmyadmin with these errors in browser’s console:
On newer version of Ubuntu the root might be “/usr/share/nginx/html” :
Restart nginx: