title: "Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL....." error
body: <p>I have just installed the XAMPP software few days ago and I'm excited to use it. The installation went pretty well. When it was finished, I opened the XAMPP software. </p>
  
  <p>I was pretty worried of the messages appearing on XAMPP software. These messages look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ArXbE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ArXbE.png" alt="(Picture1)"></a></p>
  
  <p>To make things right, I first attempted to repair the error involving Apache. The error looked like this:</p>
  
  <pre><code>8:33:34 PM  [Apache]    Problem detected!
  8:33:34 PM  [Apache]    Port 80 in use by "Unable to open process" with PID 4!
  8:33:34 PM  [Apache]    Apache WILL NOT start without the configured ports free!
  8:33:34 PM  [Apache]    You need to uninstall/disable/reconfigure the blocking application
  8:33:34 PM  [Apache]    or reconfigure Apache and the Control Panel to listen on a different port
  </code></pre>
  
  <p>I searched for some answers in Internet and I found how to repair the error in Apache above.</p>
  
  <p><strong>My Attempts</strong></p>
  
  <p>The first solution looks like this, from this Stack overflow question 
  (<a href="https://stackoverflow.com/questions/20558410/xampp-port-80-in-use-by-unable-to-open-process-with-pid-4-12">XAMPP - Port 80 in use by &quot;Unable to open process&quot; with PID 4! 12</a>)</p>
  
  <p><a href="https://i.stack.imgur.com/4QbtN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4QbtN.png" alt="(Picture3)"></a></p>
  
  <p>I was able to follow it, but the problem is the error still appears on the XAMPP, presumably because I wasn't able to find the software 
  named "World Wide Web Publishing Service" and the highest-voted comment hinted on disabling the "SQL Server Reporting Service(MSSQLSERVER)", 
  which involves looking in Visual Studio (I had the Visual Studio 2012 Ultimate) which can make my laptop very laggy, finding the SQL Server data tools futile, and presents too many processes and clicks.</p>
  
  <p>The command "net stop was /y" didn't work because I was shown an error encircled below:</p>
  
  <p><a href="https://i.stack.imgur.com/x8P4o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x8P4o.png" alt="(Picture5.1.1)"></a></p>
  
  <p>The second solution looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/CFJMI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CFJMI.png" alt="(Picture4)"></a></p>
  
  <p>I was able to follow it. I was able to find the term "Listen 80" on the text file and I changed it to "Listen 8080" and the term "localhost:80" and I changed it to "localhost:8080". </p>
  
  <p>I found the "Listen 80" keyword that should be changed to "Listen 8080" (look at the "Listen 8080" word highlighted in blue)</p>
  
  <p><a href="https://i.stack.imgur.com/BQJ27.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BQJ27.png" alt="(Picture5.1)"></a></p>
  
  <p>I found the "localhost:80" keyword that should be changed to "localhost 8080" (look at the "localhost 8080" word highlighted in blue)</p>
  
  <p><a href="https://i.stack.imgur.com/vB9vh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vB9vh.png" alt="(Picture5.2)"></a></p>
  
  <p>I closed the XAMPP software and opened the said software. I was relieved because the I can only see the error involving MySQL. But when I clicked on the "Start" button on the "Apache", a new error appears, which I'm going to solve in the near future. The new error is enclosed in a red box below:</p>
  
  <p><a href="https://i.stack.imgur.com/hodGj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hodGj.png" alt="(Problem6)"></a></p>
  
  <p>Now, I partially solved my problem regarding "Port 80 in use by "Unable to open process" with PID 4!" error, but it hasn't end because 
  I get a new error.</p>
  
  <p>Now we turn on attempting to repair the error involving MySQL. The error looked like this:</p>
  
  <pre><code>9:56:28 PM  [mysql]     Problem detected!
  9:56:28 PM  [mysql]     Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!
  9:56:28 PM  [mysql]     MySQL WILL NOT start without the configured ports free!
  9:56:28 PM  [mysql]     You need to uninstall/disable/reconfigure the blocking application
  9:56:28 PM  [mysql]     or reconfigure MySQL and the Control Panel to listen on a different port
  </code></pre>
  
  <p>I searched for some answers in Internet and I found how to repair the error in MySQL above.</p>
  
  <p><strong>My Attempts</strong></p>
  
  <p>The first solution looks like this, from this Stack overflow question:
  (<a href="https://stackoverflow.com/questions/18177148/xampp-mysql-does-not-start">xampp MySQL does not start</a>)</p>
  
  <p><a href="https://i.stack.imgur.com/NpVRn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NpVRn.png" alt="(Picture7)"></a></p>
  
  <p>I was able to follow it, but the problem is the error still appear on the XAMPP. I don't know where I messed up. I found the my.ini file in an unexpected place as shown encircled in red.</p>
  
  <p><a href="https://i.stack.imgur.com/ck8KJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ck8KJ.png" alt="(Problem8)"></a></p>
  
  <p>Then I followed the solution stated. I changed the port 3306 into 3307 in the my.ini file. I changed it in this part of the file (Shown being highlighted in blue).</p>
  
  <p><a href="https://i.stack.imgur.com/S9jX0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S9jX0.png" alt="(Problem9)"></a></p>
  
  <p>I closed the XAMPP software and opened it again. Surprise, surprise, the same error was still there on start-up.</p>
  
  <p>When I tried the alternate way to find the my.ini file to change the port number from 3306 to 3307 by following the path folders (by default, it is xampp\php\php.ini). I installed the XAMPP software on drive D because it has much free space there. So I followed the path folders and I'm disappointed, because there were TWO ini files as shown below.</p>
  
  <p><a href="https://i.stack.imgur.com/1YriQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1YriQ.png" alt="(Problem9.1)"></a></p>
  
  <p>What would I do to this two php.ini files? I won't dare touch them.</p>
  
  <p>The second solution looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/OQ9Dx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OQ9Dx.png" alt="(Picture10)"></a></p>
  
  <p>It's almost similar to the alternative solution preceded, so it's pretty useless.</p>
  
  <p>My question is:</p>
  
  <blockquote>
    <p>How do we correct the error </p>
  </blockquote>
  
  <pre><code>"Port 3306 in use by ""C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"!" 
  </code></pre>
  
  <blockquote>
    <p>if the preceding solutions that worked on others doesn't work on me? Am I facing a unique situation?</p>
  </blockquote>