Error: MySQL shutdown unexpectedly Xampp server

Error: MySQL shutdown unexpectedly.This may be due to a blocked port, missing dependencies,
12:23:06 PM [mysql] improper privileges, a crash, or a shutdown by another method.
12:23:06 PM [mysql] Press the Logs button to view error logs and check
12:23:06 PM [mysql] the Windows Event Viewer for more clues
12:23:06 PM [mysql] If you need more help, copy and post this
12:23:06 PM [mysql] entire log window on the forums

  1. You can change the port number of Mysql from xampp from 3306 to 3307 or 3308 as you wish, if it still didn’t work out then use the below steps.
  2. Go to Task Manager , Process and then End process the current mysql process and then now you can start the mysql again from xampp it will workout



Hide DB from Mysql PHPmyadmin

To hide the database from the phpmyadmin follow the below steps,

  1. Go to xampp folder  , open phpmyadmin folder
  2. open the file named “”
  3. paste the below code  ”   $cfg[‘Servers’][$i][‘hide_db’] = ‘^DatabaseName$’; “
  4. Specify the database name which you want to hide after ^ symbol
  5. That’s it.


Mysql is not recognized as an internal or external command windows OS

Having XAMPP installed when i try to type mysql in my windows command prompt it would give me the following error:

'mysql' is not recognized as an internal or external command, operable program or batch file.

This simply means that the ‘mysql’ excutable command file (mysql.exe) was not added to your system path therefore the system was unable to locate this file. To add the ‘mysql’ to system path try to locate the ‘mysql’ resident folder. In my case (Windows7) it was


Copy it (to clipboard) and go to Control Panel -> System and Security -> System and paste the copied folder path into Variable value: field of Edit System Variable pop up. Prefix it with a semi-colon (;) to separate it from other existing values (see image below – click to open larger image)