mysql not starting in xampp error on port 3306

Nice to be back with another solution for a common (not so) problem which google takes some time to find a proper solution.

 

As mentioned in the title of the post, this thing happens when i was installing xampp server on my office computer.

 

After successfully installing the xampp server, i was trying to start the mysql service using the control panel.

 

But when i start the mysql service, it was trying to start but finally it was failing to start on port 3306. It gave some error about port 3306.

 

After few hours of google search i realized that the root cause for this issue was that port 3306 is using by another mysql service which was installed from another application. Then i had to change the port number to another one to start the mysql service on xampp server.

 

To change the port successfully, i had to change the port number in following files in the mentioned manner.

 

You can change the port number to 3308 from 3306 in \xampp\mysql\bin\my.ini file in a couple of places.

 

There is also a couple of default MySQL port settings in the \xampp\php\php.ini file that would also need changing.

 

Save the files and restart Apache and MySQL to test.

 

Cheers !!!!!!!!!

13 thoughts on “mysql not starting in xampp error on port 3306

  1. The problem is that two mysql services are installed….
    One service is installed by a manager for databases and the other service is installed by xampp.
    Another solution might be to stop the service provided by the program manager and
    start xampps service .. from Windows -> Services.. and then you wont have to changes ports.

    • Yeah true. But sometimes system does not allow you to stop the service, even within the service manager of windows. In such a situation, you can use this method. If you can stop the service, then you don’t need to change the port.

  2. i change the port number to 3308 from 3306 in \xampp\mysql\bin\my.ini file in a couple of places and MySQL port settings in the \xampp\php\php.ini file.but i can’t start the MySQL service, it still conflict port 3306

    • To what the man says, go through the various config files via XAMPP (use Notepad++) and ctrl+f to find each instance of 3306 – changing each to 3308. Then shut XAMPP and restart it. Simple

  3. hi.after this changes u should also change the main port of mysql;go forward as this
    xampp control panel>config>ports setting
    and in mysql section,change the main port number to what u chose before.
    its done now!

  4. hi
    plz help me out with two prob
    1-how to know port occupied or not
    2-my oracle 11g is not instaliing
    3-eleaborate the effect of servies turing on or off or manual or automatic

  5. tried that but no change…this is my log window
    8:30:29 AM [main] Initializing Control Panel
    8:30:29 AM [main] Windows Version: Windows 7 Ultimate SP1 32-bit
    8:30:29 AM [main] XAMPP Version: 1.8.3
    8:30:29 AM [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
    8:30:29 AM [main] Running with Administrator rights – good!
    8:30:29 AM [main] XAMPP Installation Directory: “c:\xampp\”
    8:30:30 AM [main] Checking for prerequisites
    8:30:30 AM [main] All prerequisites found
    8:30:30 AM [main] Initializing Modules
    8:30:31 AM [main] Starting Check-Timer
    8:30:31 AM [main] Control Panel Ready
    8:32:00 AM [mysql] Attempting to start MySQL app…
    8:32:02 AM [mysql] Status change detected: running
    8:32:10 AM [mysql] Status change detected: stopped
    8:32:10 AM [mysql] Error: MySQL shutdown unexpectedly.
    8:32:10 AM [mysql] This may be due to a blocked port, missing dependencies,
    8:32:10 AM [mysql] improper privileges, a crash, or a shutdown by another method.
    8:32:10 AM [mysql] Press the Logs button to view error logs and check
    8:32:10 AM [mysql] the Windows Event Viewer for more clues
    8:32:10 AM [mysql] If you need more help, copy and post this
    8:32:10 AM [mysql] entire log window on the forums

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s