Many times, the root cause of crashes, slowdowns, or other unexpected behavior in MySQL can be checked by analyzing its error logs. The default location for the MySQL on Ubuntu systems is /var/log/mysql/error.log. In several cases, the error logs are most easily read with the lessprogram, which is a command line utility that enables you to see the files but not edit them:
sudo less /var/log/mysql/error.log
If MySQL is behaving differently, you can get more information about the trouble’s source by executing this command and identifying the error based on the log’s contents.