Fix: Can't create/write to file '/var/run/mysqld/mysqld.pid'

If you're facing the problem do the following:

Run the CMD to check the dir/file is exists or not:

ls -l /var/run/mysqld/

If it doesn't exist, now, follow the above step.

Run the following command lines:

mkdir /var/run/mysqld 
chown -R mysql:mysql /var/run/mysqld
service mysqld restart

It should solve the issue. If happens again than,

Create a new file /etc/tmpfiles.d/mysql.conf:

# systemd tmpfile settings for mysql
# See tmpfiles.d(5) for details

d /var/run/mysqld 0755 mysql mysql -

After reboot, MySQL should start normally.

  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...