nontoxice
nontoxice

Reputation: 17

(phpmyadmin) how do I change $cfg['Servers'][$i]['host'] for remote server?

I think phpmyadmin index.php is called config.inc.php when executed.

So I tried in config.inc.php

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = $_GET['test']; // I changed here
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;

and call url like this.

http://localhost/index.php?test=211.212.14.11

but I got display host error and not working. how can I do?

Upvotes: 0

Views: 3534

Answers (1)

Isaac Bennetch
Isaac Bennetch

Reputation: 12442

Instead of using GET here, which is sanitized by phpMyAdmin, the proper syntax is to put the IP address or hostname directly in for the directive, such as $cfg['Servers'][$i]['host'] = '192.168.5.6'; or $cfg['Servers'][$i]['host'] = 'db.example.com';

If you want to be able to define an arbitrary host at login time, look in to the $cfg['AllowArbitraryServer'] directive (when set to true, you can enter any server on the logon page).

Upvotes: 1

Related Questions