19
votes

I have installed the latest XAMPP with MySQL version 14.14 Distrib 5.6.21, the problem is in my computer, I already have a MySQL database installed by other program that I am using.

So I configure the XAMPP MySQL port to 3307 (default is 3306) inside the my.ini file. However, now my localhost/phpmyadmin seems to read the database installed by the other program, not the one in XAMPP, and also when I test using some PHP files, it shows that I am connected to the database even though XAMPP is turned off (XAMPP MySQL also disconnected).

How do I change the setting of my PHPMyAdmin and localhost to connect to the MySQL port 3307?

I don't understand how all these ports and the database work.

5

5 Answers

36
votes

Goto xampp>phpMyAdmin Directory.

Find the config.inc.php file.

Now change this line:

$cfg['Servers'][$i]['host'] = '127.0.0.1';

To

$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
4
votes

To configure phpMyAdmin to connect to a different port from the default, edit your config.inc.php file and add a line like:

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

(of course substituting any port number as needed). You can also see the official documentation.

0
votes

The following worked for me, I just added my port code to:

$cfg['Servers'][$i]['host'] = '127.0.0.1:3308';

0
votes

Add below line under phpMyAdmin/config.inc.php

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

in my case the port number is 8111.

0
votes

First open the following path:

  C:\xampp\phpMyAdmin

Add the following string in config.inc.php file.

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