What is an error log?
MySQL is the database program behind many websites. An error log is a text file where it writes down problems, warnings and start-up messages. It is like a diary of what went wrong. When your site shows database errors, this file often tells you why.
Option 1: cPanel (shared hosting)
On shared hosting you cannot see the server's own MySQL log. You can look at your account's web error log instead, which shows database errors from your site.
- Log in to cPanel.
- Open Errors in the Metrics section. It shows the latest errors for your site.
- Look for lines that mention
mysqli,databaseorSQL.
You can also open File Manager and look for a file named error_log in your site folders. For the real MySQL log, open a ticket at https://secure.hostvento.com/submitticket.php.
Option 2: WHM (server owners)
- Log in to WHM as root.
- Search for Error Log or SQL Services. Menu names can vary by version.
- Open the log viewer to see the latest lines.
Option 3: SSH (VPS or dedicated, root access)
SSH lets you type commands on your server.
- Log in over SSH as root.
- Ask MySQL where the log is:
mysql -u root -p -e "SHOW VARIABLES LIKE 'log_error';"
This prints the full path of the log file.
- Common places are:
/var/log/mysqld.log
/var/log/mysql/error.log
/var/lib/mysql/HOSTNAME.err
- Show the last 50 lines:
tail -n 50 /var/log/mysqld.log
- Watch new lines as they arrive. Press
Ctrl+Cto stop:
tail -f /var/log/mysqld.log
- Search for the word "error":
grep -i error /var/log/mysqld.log
On MariaDB, the file name may start with mariadb.
Reading the log
- Each line starts with a date and time.
- Words like
[ERROR]and[Warning]mark the type. - "Table is marked as crashed" means a table needs repair.
- "Out of memory" means the server needs more memory or lighter settings.
- "Disk full" means free some disk space.
Quick recap
- The error log is a text file of MySQL problems.
- On shared hosting use cPanel's Errors page or ask support.
- On a VPS, find the path with
SHOW VARIABLES LIKE 'log_error';. - Read it with
tailandgrep. - Look for lines marked
[ERROR].