How to Change MySQL Port in Xampp

To change default MySQL port number 3306 in Xampp windows 11|10; Open the my.ini file, which is located in C:\xampp\mysql\bin on Windows 11|10, and find port 3306 in this file to change it to your custom port number.

There can be many reasons for changing the mysql port number in xampp, like the default port of mysql is 3306, if any other application in your Windows system is running using 3306 port, then xampp mysql server is not working.

How to Change MySQL Port Numbers in Xampp Windows 11|10

Here are some steps for changing the default mysql port number 3306 in XAMPP Server with Windows 11:

Step 1 – Stop Apache and MySQL in Xampp

To change the default port in the XAMPP server, you first need to stop Apache and MySQL in the XAMPP server.

Step 2 – Edit my.ini File

Open the my.ini file from mysql\bin configuration directory on any text editor, which is located C:\xampp\mysql\bin.

Step 3 – Change MySQL Default Port 3306 Number Xampp

Press ctrl + f and type 3306 to find the default port=3306 number in my.ini file and change it with another port number; You can change the default port number in the file like this:

port=3306

To

port=3307

Save and close this file to apply the changes.

And config.inc.php, which is in C:\xampp\phpmyadmin\, Find $cfg['Servers'][$i]['host'] = '127.0.0.1' line in this file and change it to $cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1:3307’, You can change the default port number in the file like this:

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

To

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

Step 4 – Restart Apache and MySQL Server in Xampp

Now it’s time to restart Apache and MySQL in Xampp server, Open the XAMPP control panel, and then restart them again.

Conclusion

That’s it; You have learned how to change the default mysql port number 3306 in XAMPP on my.ini file.

Recommended Tutorials

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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