-1

The issue right now is that I want to maintain a database and I have planned to manage that with phpmyadmin and i have configured it but right now what it looks like is

mydomain.com/phpmyadmin

What now is I Want

anotherdomain.com ==> phpmyadmin management site

so are there any ways to do this

I am using centos 7 any help will do great thank you

ram khanal
  • 23
  • 1
  • 4

2 Answers2

2

First of all, consider not installing phpMyAdmin:

phpMyAdmin is a completely unnecessary and insecure software that has already collected 252 CVE registered vulnerabilities over its lifetime.

If for some strange reason you still want to use it, then you can install it on a separate subdomain, and ideally, make it "secret", e.g. as on this guide:

server {
    server_name pma-gj4lrxidp.example.com;
    ...
    include global/allowed-ips-pma.conf;
    root /usr/share/phpMyAdmin;
    location ~ \.php$ {
        # mysqldump can take potentially very long time; adjust as needed
        fastcgi_read_timeout 360;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm-default.sock;
        fastcgi_index index.php;
        include fastcgi_params;

        # no big headers there:
        fastcgi_buffer_size 2k;

        # set client body size to 32M #
        client_max_body_size 32M;
    }
    # These directories do not require access over HTTP
    location ^~ /libraries/ {
        deny all;
    }
    location ^~ /setup/lib/ {
        deny all;
    }
    location ^~ /setup/frames/ {
        deny all;
    }
}   
Danila Vershinin
  • 5,286
  • 5
  • 17
  • 21
  • What should people use instead of phpMyAdmin? – Overmind Feb 12 '21 at 07:38
  • In fact, the other answer mentions that: "Any MySQL client can reach to any MySQL server, barring network limitations". For details how you can read the referenced [article](https://www.getpagespeed.com/server-setup/security/stop-installing-phpmyadmin) from my answer. – Danila Vershinin Feb 12 '21 at 07:39
  • So we can use MySQL Workbench instead. Thanks. Good info. – Overmind Feb 12 '21 at 08:05
0

Any MySQL client can reach to any MySQL server, barring network limitations.

The "normal" connection is via a "socket" on the same server. By using a hostname or IP-address, PHPMyAdmin can look at MySQL on some other server (or VM).

The optional "port" (default is 3306) is a way of having multiple servers on a single machine.

Note: I did not use "domain" in the discussion above. "google.com" is a domain, but there are a zillion servers, many of them running MySQL (or other db software), in that domain. You would need to know the specific machine name or IP to get at one. (And then you would have to fight security barriers.

A more likely example is amazon.com (or some other cloud provider). They may let you get at every one of your servers via different hostnames and/or IP-addresses -- all from the same client (such as PHPMyAdmin).

And each of what you see as a "server" may actually be just a piece (VM) of a physical machine.

Rick James
  • 2,463
  • 1
  • 6
  • 13