I changed MySQL port in XAMPP, now how do I listen to the new port?
Solution 1
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';
Solution 2
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.
Solution 3
First open the following path:
C:\xampp\phpMyAdmin
Add the following string in config.inc.php file.
$cfg['Servers'][$i]['port'] = '3307';
Charas
Updated on July 09, 2022Comments
-
Charas almost 2 years
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.
-
Charas about 9 yearsWell, thank you very much for your answer, it works, but i actually hope for some elaboration or any reference where I can study on more, such as what number of ports are available and can be used for mysql ? also how does port 3307 differ from the default port 3306 ? thx a lot anyway.
-
Pradeep Rajput about 9 yearsHere is the ports list iss.net/security_center/advice/Exploits/Ports/default.htm
-
Charas about 9 yearsHi, sorry to bother once again, I just realized when I open localhost, my localhost is not connected to the new mysql port 3307, how do I set localhost to connect to the port 3307 ? thx.
-
Charas about 9 yearsnvm, I solved it, change mysqli default port in the php.ini file, thx!
-
gtzinos over 8 yearsYou need 127.0.0.1:port_number when you change your http port from default which is 80 to one another !!!
-
Pierre-Alexis de Solminihac almost 6 yearsWhy the need to restart the server?
-
Pradeep Rajput almost 6 yearsNo need to restart server if you make changes only in config.inc.php