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

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.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix defaultwebpage.cgi on a webserver

Running the following commands solves the above problem:   /scripts/updateuserdomains...

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Install Let's Encrypt SSL in cPanel/WHM

Let's Encrypt, a valid, open-source license that offers free SSL for your domains. The Let's...

Fix Email Issue on a server using the MSFE

To solve the problem of not sending/receiving email on a server using the MSFE / Mailscanner...

Domain names are not showing in WHM

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