-1

I cannot connect to mysql server on Windows 7 from my phpMyAdmin on Linux machine.

I've configured phpMyAdmin by modifying common.inc.php. I've added at the bottom of common.inc.php the following lines:

$i=2;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName';      //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password';  //password
$cfg['Servers'][$i]['auth_type'] = 'config';   // keep it as config
$i++;

I see a drop down menu with remote server listed, but when I selected a remote server phphMyAdmin returns to localhost and it doesn't connect to remote without error messages.

Using mysql command to connect to the remote database server and using the same user/password, I can successfully connect to the database server.

The versions are:

PHP 5.4.16 Development Server
phpMyAdmin 4.4.15.10
MySQL 5.6.32 - MySQL Community Server (GPL)

The request is initiated from the post Error from phmpMyAdmin when is configured in order to access remote server with local phpMyAdmin client where I have entered a request regarding the configuration of phpMyAdmin

famedoro
  • 1,223
  • 2
  • 17
  • 41

3 Answers3

0

Using the port number in the 'host' directive is not supported. Use the '$cfg['Servers'][$i]['port']' directive to indicate the port number. https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_port

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29
0

I've resolved in this way: put the setting lines after $GLOBALS['server'] = 0; with the variable i initialized to 1 ( $i=1; ) instead of put them at the bottom of common.inc.php.

famedoro
  • 1,223
  • 2
  • 17
  • 41
0

You can access the remote server by adding a block of code in your phpmyadmin config file...

$i++;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';

try this

Akshit Ahuja
  • 337
  • 2
  • 15