25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

MySQL error log cPanel – let’s explore more about it

by | Feb 22, 2021

Got stumbled by any MySQL error and would like to view the error log in CPanel to find the reason for it?

MySQL error logs provide the exact reason behind any MySQL error. Referring to this, we can fix any MySQL errors in the server.

However, there can be cases where the error log itself goes missing or show up some problems.

Here at Bobcares, we receive requests to enable the MySQL error log cPanel and check its issues as a part of Server Management Services for web hosts and online service providers.

Today, let’s see how our Support Engineers enable the MySQL error log and fix its related errors.

 

How to enable MySQL Error Log cPanel?

Log files play a vital role during troubleshooting any error.  We can investigate the root causes for MySQL errors and any unexpected trouble related to it through MySQL error log cPanel.  So, it is necessary to enable the MySQL Error log cPanel.

Now let’s see how our Support Engineers enable the error log.

The default path of MySQL error log is /var/lib/mysql/{SERVER_NAME}.err

Generally, the MySQL logs automatically save in the location /var/lib/mysql. Also, all the error log contents store in the file /var/lib/mysql/hostname.err. The hostname is the name of the account. We can change this filename if necessary and also provide a different location as well.

Below is the code that we add to the configuration file.

[mysqld]
log_error = /var/log/mysql/error.log

Here, a different name can be set for the file instead of error.log. We create that file with the right permissions and ownership using the below commands:

cd /var/lib/mysql
touch error.log
chmod 660 error.log
chown mysql:mysql error.log

Finally,  we can restart the MySQL service using the command:

systemctl start mysqld

 

Common errors related to MySQL error log cPanel and its fixes.

Now, let’s see some errors related to MySQL error logs and how our Support Engineers fix them.

 

1. Error log file unavailable

One of our customers approached us telling us that he was not able to find the MySQL error log file.

Also, he mentioned about the error log file generation in my.cnf file.

So, our Support Engineers started troubleshooting the issue by checking the code which was set in my.cnf file. The code was as below

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

The error logs of MySQL actually logs in the path /var/lib/mysql/{SERVER_NAME}.err. If a different name or location needs to be set then the error log must be mentioned under [mysqld] section and not under the [mysqld_safe] section. And the below code can be put within it:

log-error=/var/lib/mysql/error.log

Or instead of error.log, a different name can be set. Our Support Engineers created that file with the right permissions and ownership:

cd /var/lib/mysql
touch error.log
chmod 660 error.log
chown mysql:mysql error.log

However, the default MySQL errors stores in /var/lib/mysql/{SERVER_NAME}.err itself.

Then, we restarted the MySQL service using the below command:

systemctl start mysqld

Finally, the customer was able to find the desired error log file in the desired location.

[Need more assistance with MySQL error logs? – We’ll help you]

 

Conclusion

In short, we can check the MySQL error logs to know the root causes for MySQL errors, crashes and other unexpected behavior from MySQL. Today, we learned about MySQL error logs and its errors and how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF