Connect to external server by using phpMyAdmin

phpMyAdmin allows you to connect to multiple database servers, including external remote servers. By modifying the configuration file, you can add additional server connections and easily switch between them.

Adding External Server Configuration

To connect to an external server, add the following configuration to your phpMyAdmin config file at /etc/phpmyadmin/config.inc.php ?

Note: Ensure you have appropriate network access and credentials for the external database server before proceeding.

$i++;
$cfg['Servers'][$i]['host'] = 'HostName:port'; 
// hostname and port are provided if they are not default values
$cfg['Servers'][$i]['user'] = 'userName'; 
//user name for the remote server
$cfg['Servers'][$i]['password'] = 'Password'; 
//the password
$cfg['Servers'][$i]['auth_type'] = 'config';

Configuration Parameters

Here's what each parameter does:

  • host − The hostname or IP address of the external server, optionally followed by port number
  • user − Username for authentication on the remote database server
  • password − Password for the specified user account
  • auth_type − Set to 'config' for automatic login using stored credentials

Server Selection Interface

Once configured, phpMyAdmin will display a "Current Server:" dropdown menu containing both "127.0.0.1" (localhost) and your external server. You can easily switch between servers using this dropdown interface.

This configuration enables seamless management of multiple database servers from a single phpMyAdmin installation, making it convenient to work with both local and remote databases.

Updated on: 2026-03-15T08:34:00+05:30

367 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements