How to change the Xampp Server Ports (MySQL and Apache)

When we talk about a localhost, the first thing that strikes is Xampp. This software has enabled the doors of Apache and MySQL for every developer on a personal computer. While doing these Localhost works, there occurs many problems. One of the problem is that ‘Apache default port 80 doesn’t work!‘. This problem arises because some other function eats up the port 80. Therefore, you need another. For that, changing the default ports become necessary.

Here, you’ll also learn How you can change the port of MySQL service.

Change Xampp Server Ports

Default PORT 80 doesn’t work? Here’s the solution!

Things to know

After you do the changes given below, there may come a problem in Xampp if the code goes wrong. Or, if the new port is also already in use, Xampp won’t work. For doing these changes, be sure that you won’t change anymore words in the file I suggest you.

So, let’s give a start! πŸ˜‰

Changing the Xampp Apache Ports

Step 1:Β First, reach in the folder where you have installed your Xampp Software.

Step 2: After that, go to the destination file – apache/conf/httpd.conf

Step 3: Then just open the file in a text editor and find the string Listen 80 . Default number is 80. It means that your Xammp server is 80. Now just change it to any port you want. Here, I have changed it to Listen 82.

Step 4: Just then in the same file, find the string ServerName and then write the same port number you wrote above.

Step 5: Now stay relaxed, close off Xampp and Restart it to use your New Port!

Note*: These would surely change the ports. But, the solution of problem may or may not be solved because of other issue.

Related:Β Β WhatsApp Hacking Tool? Revealed!

Changing the MySQL ports

The default MySQL port is 3306. Sometimes, this needs to be changed. Follow these steps to enjoy your new port.

Step 1:Β First, reach in the folder where you have installed your Xampp Software.

Step 2: After that, go to the destination file – mysql/bin/my.ini (The ‘my‘ file with extension of Configuration Settings)

Step 3: In that file, you’ll be seeing some lines of code like this:

# The following options will be passed to all MySQL clients
[client] 
# password = your_password 
port = 3306
socket = "xampp / mysql / mysql.sock"

Just change the port to 3306 ---> 3308 instead of 3306.

Step 4: Just below, you would find these lines of code:

# The MySQL server
[mysqld]
port= 3306
socket = "xampp / mysql / mysql.sock"

Just like before, here also update the port attribute to 3306 ---> 3308 instead of 3306.

Step 5: And that’s all! Just close off MySQL and Start it again to see the new port working.

Note*: Just like before, These would surely change the ports. But, the solution of problem may or may not be solved because of other issue.

I hope this technically worked for you. Do write your thoughts below and let me know your feedback on this πŸ™‚ Stay connected to us on our Facebook Page.

Kumar Abhirup

I'm Kumar Abhirup. I'm running this blog passionately since February 2016 when I was 12 years old. I'm from Nashik, The vine capital of India. I share words about my life experiences and interests... all at once!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *