Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

enter image description here

like image 330
Lokomotywa Avatar asked Jan 28 '15 13:01

Lokomotywa


People also ask

Can I change MySQL port?

Edit the my. cnf file to change the built-in MySQL port. In the [mysqld] section, change the value for port .

How do I run phpMyAdmin on a different port?

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.1 or the real hostname in $cfg['Servers'][$i]['host'] .

How do I find my MySQL port number phpMyAdmin?

Another way to find out the port which MySQL Server is using on Windows is , Go to my. ini file that is MySQL configuration file and you can check the port. To find the my. ini file for MySQL Server, you can go to services and then go to properties.


1 Answers

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';
like image 110
Bima Catur Hatmoko Avatar answered Sep 19 '22 09:09

Bima Catur Hatmoko