Change Mysql Server Port in Phpmyadmin

I have two MySql instances ( 5.1.73-1-log ) running on my server, one on port 3306 (default), one on port 3307. Now I want to change 3.3.7deb7 ( 3.3.7deb7 ) to take a second instance , at 3307, instead by default. Thus, I add the following line to config.inc.php :

  $cfg['Servers'][$i]['port'] = '3307'; 

Now, although PhpMyAdmin says localhost:3307 (see screenshot), the databases it accesses still belong to the instances that run on the default port.

How to change settings to make port change real?

enter image description here

+6
source share
2 answers

From the PhpMyAdmin documentation ...

If you use localhost as the host name, MySQL ignores this port number and connects to the socket, so if you want to connect to a port other than the default port, use 127.0.0.1 or the real host name in $cfg['Servers'][$i]['host'] .

+3
source

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'; 
0
source

Source: https://habr.com/ru/post/1212106/


All Articles