W3docs

phpMyAdmin allow remote users

phpMyAdmin is a web-based tool for managing MySQL and MariaDB databases.

phpMyAdmin is a web-based tool for managing MySQL and MariaDB databases. By default, installation packages often restrict access to localhost via web server configuration. To allow remote users to access the phpMyAdmin interface, you must configure your web server to accept connections from external IPs and ensure your firewall permits the traffic.

Web Server Configuration phpMyAdmin is served by your web server, so remote access is controlled there rather than in config.inc.php.

Apache Example:

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php
    Require all granted
</Directory>

Nginx Example:

location /phpmyadmin {
    root /usr/share/;
    index index.php;
    try_files $uri $uri/ =404;
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Authentication Method The auth_type setting in config.inc.php controls how users log in, not network access. Changing it from cookie to http enables browser-based HTTP authentication, but it does not bypass web server or firewall restrictions. Legacy versions (pre-5.0) used $cfg['AllowRemoteAccess'] = true; in config.inc.php, but this directive was deprecated and removed in modern releases.

Security Considerations Exposing phpMyAdmin to the internet increases security risks. Follow these best practices:

  • Restrict access to trusted IP addresses using web server directives or a firewall.
  • Use strong, unique passwords for database accounts.
  • Serve phpMyAdmin over HTTPS to encrypt credentials in transit.
  • Consider using a VPN or SSH tunnel for administrative access instead of direct internet exposure.