'Change Port of Mysql Server in Phpmyadmin
I have two instances of MySql (5.1.73-1-log) running on my server, one on port 3306 (default), one on port 3307. Now, I want to change PhpMyAdmin (3.3.7deb7) to take the second instance, on 3307, instead the default one.
Thus, I add the following line to config.inc.php:
$cfg['Servers'][$i]['port'] = '3307';
Now, though PhpMyAdmin says localhost:3307 (look Screenshot), the databases that it accesses are still those from the instance that runs on the default port.
How do I change the settings in order to make the port change real?

Solution 1:[1]
You can change this line:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
with this line:
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
Solution 2:[2]
From the PhpMyAdmin documentation...
If you use localhost as the hostname, MySQL ignores this port number and connects with the socket, so if you want to connect to a port different from the default port, use
127.0.0.1or the real hostname in$cfg['Servers'][$i]['host'].
Solution 3:[3]
first open Xamppp Control Panel click on Config Button, at the next page click on Services and Port Settings, at that page you can set all ports for all of your services. also you should change content of Phpmyadmin(config.inc.php) file as below
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port']= 'your preferred port number';
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adriaan |
| Solution 2 | lloydpick |
| Solution 3 |
