Sarathlal N

Change phpMyAdmin access location - LEMP server

If you have a LAMP Server or LEMP Server, every one know that there is a chance for phpMyAdmin installation in http://your_domain_or_IP/phpmyadmin.

The /phpmyadmin is the default access location for phpMyAdmin installation.

But we can easily change this one in to custom location like http://your_domain_or_IP/hidethis on the LEMP server.

First go the Nginx document root directory.

cd /var/www/html

During the phpMyAdmin installation process, the system will create a symbolic link on this location that target to phpMyAdmin installation folder.

We can see the details by using ls command.

ls -l

The result will look like,

total 8
-rw-r--r-- 1 root root 537 Mar  4 06:46 50x.html
-rw-r--r-- 1 root root 612 Mar  4 06:46 index.html
lrwxrwxrwx 1 root root  21 Aug  6 10:50 phpmyadmin -> /usr/share/phpmyadmin

As you can see, we have a symbolic link called phpmyadmin in this directory.

To change the accesss location, we have to rename this symbolic link.

sudo mv phpmyadmin hidethis
ls -l

The output will look like,

total 8
-rw-r--r-- 1 root root 537 Mar  4 06:46 50x.html
-rw-r--r-- 1 root root 612 Mar  4 06:46 index.html
lrwxrwxrwx 1 root root  21 Aug  6 10:50 hidethis -> /usr/share/phpmyadmin

Just restart Nginx Server.

sudo service nginx restart

In browser, go to the new address (http://server_domain_or_IP/hidethis) and we can see our phpMyadmin Login screen.

Also the default address (http://server_domain_or_IP/phpmyadmin) will start to return 404 error page.

Got a project in mind? Send me a quick message, and I'll get back to you within 24 hours!.

Recent Posts

  1. A Guide to Configuring JavaScript and SCSS Paths in WordPress Plugins with @wordpress/scripts
  2. Disabling Payment Methods in WooCommerce Based on Conditions
  3. How to Update Product Quantity in WooCommerce Using Custom Code
  4. Dynamically Generating a Table of Contents in WordPress
  5. Direct Checkout in WooCommerce - Add Product to Cart from Checkout Page & Skip Shop, Product, and Cart Pages

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.