1

I noticed that XAMPP and Docker don't mix so I tried to change the MySQL port to 3307 instead of Default 3306 but all tries failed.

My Steps:

  • Change the MySQL port from XAMPP Config [Services and Port Settings]
  • Modify in [\xampp\properties.ini]
  • Modify in [\xampp\mysql\bin\my.ini]
  • Modify in [\xampp\php\php.ini]
  • Add Port $cfg['Servers'][$i]['port'] = 3307; in [\xampp\phpMyAdmin\config.inc.php]
  • I tried to add the new port with host $cfg['Servers'][$i]['host'] = '127.0.0.1:3307'; But not working either.

Restrat PC and Start xampp as admin, and MySQL service still running on 3306.

What should I do?

Thanks

Hady Shaltout
  • 606
  • 1
  • 9
  • 22
  • For what it's worth, PHP has no way to affect what port MySQL Server is listening on. Out of curiosity, it's trivial to set ports in Docker, is the native MySQL installation the one that has to be changed? – Álvaro González Dec 24 '22 at 13:27
  • @ÁlvaroGonzález I've tried to make Container to mySQL in Docker with different port, but I failed, so I've decided to change the xampp mysql instead – Hady Shaltout Dec 24 '22 at 13:35
  • https://stackoverflow.com/questions/41637013/docker-mysql-on-different-port – Álvaro González Dec 24 '22 at 15:06
  • That's what I tried before, I've tried the both solutions and the xampp result: Error: MySQL shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check – Hady Shaltout Dec 24 '22 at 15:59

0 Answers0