It is necessary to stop MySQL before exiting XAMPP. If you exit XAMPP without stopping MySQL, it may corrupt the MySQL data files. Due to this, you may experience several problems with MySQL, like the shutting down of MySQL unexpectedly. If you are experiencing such a problem, it might be possible that the MySQL data files on your system are corrupted. We have described some troubleshooting methods that may help you get rid of this problem.